Example #1
0
	def print_help(self, with_description=True):
		"""Print description, usage and a detailed help message.

		@type with_description: bool
		@param with_description: if true, print module's __doc__ string
		"""

		if with_description:
			print()
			print(__doc__.strip())
			print()
		if self.warning:
			print()
			for line in self.warning:
				sys.stderr.write(pp.warn(line))
			print()
		print(mod_usage(mod_name=self.module_name, arg=self.arg_spec, optional=self.arg_option))
		print()
		print(pp.command("options"))
		print(format_options( self.formatted_options ))
		if self.formatted_args:
			print()
			print(pp.command(self.arg_spec))
			print(format_options(self.formatted_args))
		print()
Example #2
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

    @param with_description (bool): Option to print module's __doc__ or not
    """

    if with_description:
        print(__doc__)
    print(main_usage())
    print()
    print(pp.globaloption("global options"))
    print(format_options((
        (" -h, --help", "display this help message"),
        (" -q, --quiet", "minimal output"),
        (" -C, --no-color", "turn off colors"),
        (" -N, --no-pipe", "turn off pipe detection"),
        (" -V, --version", "display version info")
    )))
    print()
    print(pp.command("modules") + " (" + pp.command("short name") + ")")
    print(format_options((
        (" (b)estkeywords", "display the best keywords for a given package"),
        (" (d)ependencies", "display the direct dependencies for a given package"),
        (" (m)askedkeywords", "display keywords for a given package converting to masked as unstable"),
    )))
Example #3
0
	def print_help(self, with_description=True):
		"""Print description, usage and a detailed help message.

		@type with_description: bool
		@param with_description: if true, print module's __doc__ string
		"""

		if with_description:
			print()
			print(__doc__.strip())
			print()
		if self.warning:
			print()
			for line in self.warning:
				sys.stderr.write(pp.warn(line))
			print()
		print(mod_usage(mod_name=self.module_name, arg=self.arg_spec, optional=self.arg_option))
		print()
		print(pp.command("options"))
		print(format_options( self.formatted_options ))
		if self.formatted_args:
			print()
			print(pp.command(self.arg_spec))
			print(format_options(self.formatted_args))
		print()
Example #4
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

    if with_description:
        print(__doc__.strip())
        print()
    print("Default depth is set to 1 (direct only). Use --depth=0 for no max.")
    print()
    print(mod_usage(mod_name="depgraph"))
    print()
    print(pp.command("options"))
    print(
        format_options(
            (
                (" -h, --help", "display this help message"),
                (" -A, --no-atom", "do not show dependency atom"),
                (" -M, --no-mask", "do not show masking status"),
                (" -U, --no-useflags", "do not show USE flags"),
                (" -l, --linear", "do not format the graph by indenting dependencies"),
                ("     --depth=N", "limit dependency graph to specified depth"),
            )
        )
    )
Example #5
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

    @type with_description: bool
    @param with_description: if true, print module's __doc__ string
    """

    if with_description:
        print(__doc__.strip())
        print()
    print("Default depth is set to 1 (direct only). Use --depth=0 for no max.")
    print()
    print(mod_usage(mod_name="depgraph"))
    print()
    print(pp.command("options"))
    print(
        format_options(
            (
                (" -h, --help", "display this help message"),
                (" -A, --no-atom", "do not show dependency atom"),
                (" -M, --no-mask", "do not show masking status"),
                (" -U, --no-useflags", "do not show USE flags"),
                (" -l, --linear", "do not format the graph by indenting dependencies"),
                ("     --depth=N", "limit dependency graph to specified depth"),
            )
        )
    )
Example #6
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

    if with_description:
        print(__doc__.strip())
        print()
    print(mod_usage(mod_name="files"))
    print()
    print(pp.command("options"))
    print(
        format_options(
            ((" -h, --help", "display this help message"),
             (" -m, --md5sum", "include MD5 sum in output"),
             (" -s, --timestamp",
              "include timestamp in output"), (" -t, --type",
                                               "include file type in output"),
             ("     --tree",
              "display results in a tree (turns off other options)"),
             (" -f, --filter=RULES", "filter output by file type"),
             ("              RULES",
              "a comma-separated list (no spaces); choose from:"))))
    print(" " * 24, ', '.join(pp.emph(x) for x in FILTER_RULES))
Example #7
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

    if with_description:
        print(__doc__.strip())
        print()
    print(mod_usage(mod_name="has", arg="env_var [expr]"))
    print()
    print(pp.command("options"))
    print(
        format_options(
            (
                (" -h, --help", "display this help message"),
                (" -I, --exclude-installed", "exclude installed packages from search path"),
                (" -o, --overlay-tree", "include overlays in search path"),
                (" -p, --portage-tree", "include entire portage tree in search path"),
                (" -F, --format=TMPL", "specify a custom output format"),
                ("              TMPL", "a format template using (see man page):"),
            )
        )
    )
Example #8
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

    @type with_description: bool
    @param with_description: if true, print module's __doc__ string
    """

    if with_description:
        print(__doc__.strip())
        print()
    print(mod_usage(mod_name="depends"))
    print()
    print(pp.command("options"))
    print(
        format_options((
            (" -h, --help", "display this help message"),
            (
                " -a, --all-packages",
                "include dependencies that are not installed (slow)",
            ),
            (" -D, --indirect",
             "search both direct and indirect dependencies"),
            ("     --depth=N",
             "limit indirect dependency tree to specified depth"),
        )))
Example #9
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

    if with_description:
        print(__doc__.strip())
        print()
    print(mod_usage(mod_name="changes"))
    print()
    print(pp.emph("examples"))
    print(" c portage                                # show latest visible "
          "version's entry")
    print(" c portage --full --limit=3               # show 3 latest entries")
    print(" c '=sys-apps/portage-2.1.6*'             # use atom syntax")
    print(" c portage --from=2.2_rc60 --to=2.2_rc70  # use version ranges")
    print()
    print(pp.command("options"))
    print(
        format_options((
            (" -h, --help", "display this help message"),
            (" -l, --latest", "display only the latest ChangeLog entry"),
            (" -f, --full", "display the full ChangeLog"),
            ("     --limit=NUM",
             "limit the number of entries displayed (with --full)"),
            ("     --from=VER", "set which version to display from"),
            ("     --to=VER", "set which version to display to"),
        )))
Example #10
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

    if with_description:
        print(__doc__.strip())
        print()

    # Deprecation warning added by djanderson, 12/2008
    depwarning = (
        "Default action for this module has changed in Gentoolkit 0.3.",
        "Use globbing to simulate the old behavior (see man equery).",
        "Use '*' to check all installed packages.",
        "Use 'foo-bar/*' to filter by category.")
    for line in depwarning:
        sys.stderr.write(pp.warn(line))
    print()

    print(mod_usage(mod_name="check"))
    print()
    print(pp.command("options"))
    print(
        format_options((
            (" -h, --help", "display this help message"),
            (" -f, --full-regex", "query is a regular expression"),
            (" -o, --only-failures", "only display packages that do not pass"),
        )))
Example #11
0
def print_help(with_description=True, with_usage=True):
    """Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

    if with_description:
        print(__doc__.strip())
        print()
    if with_usage:
        print(mod_usage(mod_name="meta"))
        print()
    print(pp.command("options"))
    print(
        format_options((
            (" -h, --help", "display this help message"),
            (" -d, --description", "show an extended package description"),
            (" -H, --herd", "show the herd(s) for the package"),
            (" -k, --keywords",
             "show keywords for all matching package versions"),
            (" -l, --license", "show licenses for the best maching version"),
            (" -m, --maintainer", "show the maintainer(s) for the package"),
            (" -r, --reverse",
             "show the output in reverse order if applicable"),
            (" -S, --stablreq",
             "show STABLEREQ arches (cc's) for all matching package versions"),
            (" -u, --useflags", "show per-package USE flag descriptions"),
            (" -U, --upstream", "show package's upstream information"),
            (" -x, --xml", "show the plain metadata.xml file"))))
Example #12
0
def print_help(with_description=True):
	"""Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

	if with_description:
		print(__doc__.strip())
		print()

	# Deprecation warning added by djanderson, 12/2008
	depwarning = (
		"Default action for this module has changed in Gentoolkit 0.3.",
		"Use globbing to simulate the old behavior (see man equery).",
		"Use '*' to check all installed packages.",
		"Use 'foo-bar/*' to filter by category."
	)
	for line in depwarning:
		sys.stderr.write(pp.warn(line))
	print()

	print(mod_usage(mod_name="check"))
	print()
	print(pp.command("options"))
	print(format_options((
		(" -h, --help", "display this help message"),
		(" -f, --full-regex", "query is a regular expression"),
		(" -o, --only-failures", "only display packages that do not pass"),
	)))
Example #13
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

    if with_description:
        print(__doc__.strip())
        print()
    print(mod_usage(mod_name="hasuse", arg="USE-flag"))
    print()
    print(pp.command("options"))
    print(
        format_options(
            ((" -h, --help", "display this help message"),
             (" -I, --exclude-installed",
              "exclude installed packages from search path"),
             (" -o, --overlay-tree", "include overlays in search path"),
             (" -p, --portage-tree",
              "include entire portage tree in search path"),
             (" -F, --format=TMPL", "specify a custom output format"),
             ("              TMPL",
              "a format template using (see man page):"))))
    print(" " * 24, ', '.join(pp.emph(x) for x in FORMAT_TMPL_VARS))
Example #14
0
def print_help(with_description=True):
	"""Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

	if with_description:
		print(__doc__.strip())
		print()
	print(mod_usage(mod_name="changes"))
	print()
	print(pp.emph("examples"))
	print (" c portage                                # show latest visible "
	       "version's entry")
	print(" c portage --full --limit=3               # show 3 latest entries")
	print(" c '=sys-apps/portage-2.1.6*'             # use atom syntax")
	print(" c portage --from=2.2_rc60 --to=2.2_rc70  # use version ranges")
	print()
	print(pp.command("options"))
	print(format_options((
		(" -h, --help", "display this help message"),
		(" -l, --latest", "display only the latest ChangeLog entry"),
		(" -f, --full", "display the full ChangeLog"),
		("     --limit=NUM",
			"limit the number of entries displayed (with --full)"),
		("     --from=VER", "set which version to display from"),
		("     --to=VER", "set which version to display to"),
	)))
Example #15
0
def print_help(with_description=True, with_usage=True):
	"""Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

	if with_description:
		print(__doc__.strip())
		print()
	if with_usage:
		print(mod_usage(mod_name="meta"))
		print()
	print(pp.command("options"))
	print(format_options((
		(" -h, --help", "display this help message"),
		(" -d, --description", "show an extended package description"),
		(" -H, --herd", "show the herd(s) for the package"),
		(" -k, --keywords", "show keywords for all matching package versions"),
		(" -m, --maintainer", "show the maintainer(s) for the package"),
		(" -S, --stablreq", "show STABLEREQ arches (cc's) for all matching package versions"),
		(" -u, --useflags", "show per-package USE flag descriptions"),
		(" -U, --upstream", "show package's upstream information"),
		(" -x, --xml", "show the plain metadata.xml file")
	)))
Example #16
0
def main_usage(module_info):
	"""Return the main usage message for analyse"""
	return "%(usage)s %(product)s [%(g_opts)s] %(mod_name)s [%(mod_opts)s]" % {
		'usage': pp.emph("Usage:"),
		'product': pp.productname(module_info["__productname__"]),
		'g_opts': pp.globaloption("global-options"),
		'mod_name': pp.command("module-name"),
		'mod_opts': pp.localoption("module-options")
	}
Example #17
0
def main_usage(module_info):
    """Return the main usage message for analyse"""
    return "%(usage)s %(product)s [%(g_opts)s] %(mod_name)s [%(mod_opts)s]" % {
        'usage': pp.emph("Usage:"),
        'product': pp.productname(module_info["__productname__"]),
        'g_opts': pp.globaloption("global-options"),
        'mod_name': pp.command("module-name"),
        'mod_opts': pp.localoption("module-options")
    }
Example #18
0
def print_help(module_info, formatted_options=None, with_description=True):
	"""Print description, usage and a detailed help message.

	@param with_description (bool): Option to print module's __doc__ or not
	"""

	if with_description:
		print()
		print(module_info["__doc__"])
		print()
	print(main_usage(module_info))
	print()
	print(pp.globaloption("global options"))
	print(format_options(GLOBAL_OPTIONS))
	print()
	if formatted_options:
		print(pp.command("modules") + " (" + pp.command("short name") + ")")
		print(format_options(formatted_options))
	else:
		print("Error: calling function did not supply formatted options")
		print()
Example #19
0
def print_help(module_info, formatted_options=None, with_description=True):
    """Print description, usage and a detailed help message.

	@param with_description (bool): Option to print module's __doc__ or not
	"""

    if with_description:
        print()
        print(module_info["__doc__"])
        print()
    print(main_usage(module_info))
    print()
    print(pp.globaloption("global options"))
    print(format_options(GLOBAL_OPTIONS))
    print()
    if formatted_options:
        print(pp.command("modules") + " (" + pp.command("short name") + ")")
        print(format_options(formatted_options))
    else:
        print("Error: calling function did not supply formatted options")
        print()
Example #20
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

	@param with_description (bool): Option to print module's __doc__ or not
	"""

    if with_description:
        print(__doc__)
    print(main_usage())
    print()
    print(pp.globaloption("global options"))
    print(
        format_options(
            ((" -h, --help", "display this help message"),
             (" -q, --quiet", "minimal output"), (" -C, --no-color",
                                                  "turn off colors"),
             (" -N, --no-pipe", "turn off pipe detection"),
             (" -V, --version", "display version info"))))
    print()
    print(pp.command("modules") + " (" + pp.command("short name") + ")")
    print(
        format_options((
            (" (b)elongs", "list what package FILES belong to"),
            (" (c)hanges", "list changelog entries for ATOM"),
            (" chec(k)", "verify checksums and timestamps for PKG"),
            (" (d)epends", "list all packages directly depending on ATOM"),
            (" dep(g)raph", "display a tree of all dependencies for PKG"),
            (" (f)iles", "list all files installed by PKG"),
            (" h(a)s",
             "list all packages for matching ENVIRONMENT data stored in /var/db/pkg"
             ), (" (h)asuse", "list all packages that have USE flag"),
            (" ke(y)words", "display keywords for specified PKG"),
            (" (l)ist",
             "list package matching PKG"), (" (m)eta",
                                            "display metadata about PKG"),
            (" (s)ize", "display total size of all files owned by PKG"),
            (" (u)ses", "display USE flags for PKG"),
            (" (w)hich", "print full path to ebuild for PKG"))))
Example #21
0
def print_help(with_description=True):
	"""Print description, usage and a detailed help message.

	@param with_description (bool): Option to print module's __doc__ or not
	"""

	if with_description:
		print(__doc__)
	print(main_usage())
	print()
	print(pp.globaloption("global options"))
	print(format_options((
		(" -h, --help", "display this help message"),
		(" -q, --quiet", "minimal output"),
		(" -C, --no-color", "turn off colors"),
		(" -N, --no-pipe", "turn off pipe detection"),
		(" -V, --version", "display version info")
	)))
	print()
	print(pp.command("modules") + " (" + pp.command("short name") + ")")
	print(format_options((
		(" (b)elongs", "list what package FILES belong to"),
		(" (c)hanges", "list changelog entries for ATOM"),
		(" chec(k)", "verify checksums and timestamps for PKG"),
		(" (d)epends", "list all packages directly depending on ATOM"),
		(" dep(g)raph", "display a tree of all dependencies for PKG"),
		(" (f)iles", "list all files installed by PKG"),
		(" h(a)s", "list all packages for matching ENVIRONMENT data stored in /var/db/pkg"),
		(" (h)asuse", "list all packages that have USE flag"),
		(" ke(y)words", "display keywords for specified PKG"),
		(" (l)ist", "list package matching PKG"),
		(" (m)eta", "display metadata about PKG"),
		(" (s)ize", "display total size of all files owned by PKG"),
		(" (u)ses", "display USE flags for PKG"),
		(" (w)hich", "print full path to ebuild for PKG")
	)))
Example #22
0
def mod_usage(mod_name="module", arg="pkgspec", optional=False):
	"""Provide a consistant usage message to the calling module.

	@type arg: string
	@param arg: what kind of argument the module takes (pkgspec, filename, etc)
	@type optional: bool
	@param optional: is the argument optional?
	"""

	return "%(usage)s: %(mod_name)s [%(opts)s] %(arg)s" % {
		'usage': pp.emph("Usage"),
		'mod_name': pp.command(mod_name),
		'opts': pp.localoption("options"),
		'arg': ("[%s]" % pp.emph(arg)) if optional else pp.emph(arg)
	}
Example #23
0
def mod_usage(mod_name="module", arg="pkgspec", optional=False):
    """Provide a consistant usage message to the calling module.

	@type arg: string
	@param arg: what kind of argument the module takes (pkgspec, filename, etc)
	@type optional: bool
	@param optional: is the argument optional?
	"""

    return "%(usage)s: %(mod_name)s [%(opts)s] %(arg)s" % {
        'usage': pp.emph("Usage"),
        'mod_name': pp.command(mod_name),
        'opts': pp.localoption("options"),
        'arg': ("[%s]" % pp.emph(arg)) if optional else pp.emph(arg)
    }
Example #24
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

    if with_description:
        print(__doc__.strip())
        print()
    print(mod_usage(mod_name=__name__.split('.')[-1]))
    print()
    print(pp.command("options"))
    print(
        format_options(((" -h, --help", "display this help message"),
                        (" -a, --all", "include all package versions"),
                        (" -i, --ignore-l10n", "don't show l10n USE flags"))))
Example #25
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.
    @type with_description: bool
    @param with_description: if true, print module's __doc__ string
    """

    if with_description:
        print(__doc__.strip())
        print()


#    print("Default depth is set to 1 (direct only). Use --depth=0 for no max.")
#    print()
    print(mod_usage(mod_name="maskedkeywords"))
    print()
    print(pp.command("options"))
    print(format_options(((" -h, --help", "display this help message"), )))
Example #26
0
def print_help(with_description=True):
	"""Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

	if with_description:
		print(__doc__.strip())
		print()
	print(mod_usage(mod_name=__name__.split('.')[-1]))
	print()
	print(pp.command("options"))
	print(format_options((
		(" -h, --help", "display this help message"),
		(" -a, --all", "include all package versions")
	)))
Example #27
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

    if with_description:
        print(__doc__.strip())
        print()
    print(mod_usage(mod_name="belongs", arg="filename"))
    print()
    print(pp.command("options"))
    print(
        format_options(((" -h, --help", "display this help message"),
                        (" -f, --full-regex", "supplied query is a regex"),
                        (" -e, --early-out", "stop when first match is found"),
                        (" -n, --name-only", "don't print the version"))))
Example #28
0
def print_help(with_description=True):
	"""Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

	if with_description:
		print(__doc__.strip())
		print()
	print(mod_usage(mod_name="which"))
	print()
	print(pp.command("options"))
	print(format_options((
		(" -h, --help", "display this help message"),
		(" -m, --include-masked", "return highest version ebuild available"),
		(" -e, --ebuild", "print the ebuild")
	)))
Example #29
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

    if with_description:
        print(__doc__.strip())
        print()
    print(mod_usage(mod_name="which"))
    print()
    print(pp.command("options"))
    print(
        format_options(((" -h, --help", "display this help message"),
                        (" -m, --include-masked",
                         "return highest version ebuild available"),
                        (" -e, --ebuild", "print the ebuild"))))
Example #30
0
def print_help(with_description=True):
	"""Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

	if with_description:
		print(__doc__.strip())
		print()
	print(mod_usage(mod_name="belongs", arg="filename"))
	print()
	print(pp.command("options"))
	print(format_options((
		(" -h, --help", "display this help message"),
		(" -f, --full-regex", "supplied query is a regex" ),
		(" -e, --early-out", "stop when first match is found"),
		(" -n, --name-only", "don't print the version")
	)))
Example #31
0
def print_help(with_description=True):
    """Print description, usage and a detailed help message.

    @type with_description: bool
    @param with_description: if true, print module's __doc__ string
    """

    if with_description:
        print(__doc__.strip())
        print()

    # Deprecation warning added by djanderson, 12/2008
    depwarning = (
        "Default action for this module has changed in Gentoolkit 0.3.",
        "Use globbing to simulate the old behavior (see man equery).",
        "Use '*' to check all installed packages.",
        "Use 'foo-bar/*' to filter by category.",
    )
    for line in depwarning:
        sys.stderr.write(pp.warn(line))
    print()

    print(mod_usage(mod_name="list"))
    print()
    print(pp.command("options"))
    print(
        format_options((
            (" -h, --help", "display this help message"),
            (" -d, --duplicates", "list only installed duplicate packages"),
            (
                " -b, --binpkgs-missing",
                "list only installed packages without a corresponding binary package",
            ),
            (" -f, --full-regex", "query is a regular expression"),
            (" -m, --mask-reason", "include reason for package mask"),
            (" -I, --exclude-installed",
             "exclude installed packages from output"),
            (" -o, --overlay-tree", "list packages in overlays"),
            (" -p, --portage-tree", "list packages in the main portage tree"),
            (" -F, --format=TMPL", "specify a custom output format"),
            ("              TMPL", "a format template using (see man page):"),
        )))
    print(" " * 24, ", ".join(pp.emph(x) for x in FORMAT_TMPL_VARS))
Example #32
0
def print_help(with_description=True):
	"""Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

	if with_description:
		print(__doc__.strip())
		print()
	print(mod_usage(mod_name="depends"))
	print()
	print(pp.command("options"))
	print(format_options((
		(" -h, --help", "display this help message"),
		(" -a, --all-packages",
			"include dependencies that are not installed (slow)"),
		(" -D, --indirect",
			"search both direct and indirect dependencies"),
		("     --depth=N", "limit indirect dependency tree to specified depth")
	)))
Example #33
0
def print_help(with_description=True):
	"""Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

	if with_description:
		print(__doc__.strip())
		print()

	# Deprecation warning added by djanderson, 12/2008
	depwarning = (
		"Default action for this module has changed in Gentoolkit 0.3.",
		"Use globbing to simulate the old behavior (see man equery).",
		"Use '*' to check all installed packages.",
		"Use 'foo-bar/*' to filter by category."
	)
	for line in depwarning:
		sys.stderr.write(pp.warn(line))
	print()

	print(mod_usage(mod_name="list"))
	print()
	print(pp.command("options"))
	print(format_options((
		(" -h, --help", "display this help message"),
		(" -d, --duplicates", "list only installed duplicate packages"),
		(" -b, --binpkgs-missing", "list only installed packages without a corresponding binary package"),
		(" -f, --full-regex", "query is a regular expression"),
		(" -m, --mask-reason", "include reason for package mask"),
		(" -I, --exclude-installed",
			"exclude installed packages from output"),
		(" -o, --overlay-tree", "list packages in overlays"),
		(" -p, --portage-tree", "list packages in the main portage tree"),
		(" -F, --format=TMPL", "specify a custom output format"),
        ("              TMPL",
			"a format template using (see man page):")
	)))
	print(" " * 24, ', '.join(pp.emph(x) for x in FORMAT_TMPL_VARS))			
Example #34
0
def print_help(with_description=True):
	"""Print description, usage and a detailed help message.

	@type with_description: bool
	@param with_description: if true, print module's __doc__ string
	"""

	if with_description:
		print(__doc__.strip())
		print()
	print(mod_usage(mod_name="files"))
	print()
	print(pp.command("options"))
	print(format_options((
		(" -h, --help", "display this help message"),
		(" -m, --md5sum", "include MD5 sum in output"),
		(" -s, --timestamp", "include timestamp in output"),
		(" -t, --type", "include file type in output"),
		("     --tree", "display results in a tree (turns off other options)"),
		(" -f, --filter=RULES", "filter output by file type"),
		("              RULES",
			"a comma-separated list (no spaces); choose from:")
	)))
	print(" " * 24, ', '.join(pp.emph(x) for x in FILTER_RULES))