Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add better --help text. closes #123 #124

Merged
merged 1 commit into from
Jun 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion johnnydep/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Display dependency tree of Python distribution"""

__version__ = "1.20.1"
__version__ = "1.20.2"

from johnnydep.lib import *
62 changes: 53 additions & 9 deletions johnnydep/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,47 @@
def main(argv=None, stdout=None):
default_fields = os.environ.get("JOHNNYDEP_FIELDS", "name,summary").split(",")
parser = ArgumentParser(prog="johnnydep", description=johnnydep.__doc__)
parser.add_argument("req", help="The project name or requirement specifier")
parser.add_argument("--index-url", "-i")
parser.add_argument("--extra-index-url")
parser.add_argument(
"req",
help=(
"The project name or requirement specifier. "
"Looks like what might you normally put after a 'pip install' "
"command (use PEP 440 syntax)."
),
)
parser.add_argument(
"--index-url",
"-i",
metavar="<url>",
help=(
"Base URL of the Python Package Index (default https://pypi.org/simple). "
"This should point to a repository compliant with PEP 503 (the simple "
"repository API) or a local directory laid out in the same format."
),
)
parser.add_argument(
"--extra-index-url",
metavar="<url>",
help=(
"Extra URLs of package indexes to use in addition to --index-url. "
"Should follow the same rules as --index-url."
),
)
parser.add_argument(
"--ignore-errors",
action="store_true",
help="Continue rendering the tree even if errors occur",
help="Continue rendering the tree even if errors occur.",
)
parser.add_argument(
"--output-format",
"-o",
choices=["human", "json", "yaml", "python", "toml", "pinned", "dot"],
default="human",
help="default: %(default)s",
help="Format to render the output (default: %(default)s).",
)
parser.add_argument(
"--no-deps",
help="Don't recurse the dependency tree",
help="Show top level details only, don't recurse the dependency tree.",
dest="recurse",
action="store_false",
)
Expand All @@ -68,10 +91,31 @@ def main(argv=None, stdout=None):
nargs="*",
default=default_fields,
choices=list(FIELDS) + ["ALL"],
help="default: %(default)s",
help=(
"Space separated list of fields to print "
"(default: {}).".format(" ".join(default_fields))
),
)
parser.add_argument(
"--for-python",
"-p",
dest="env",
type=python_interpreter,
metavar="<path>",
help=(
"Path to another Python executable. "
"If unspecified, the current runtime environment will be used "
"(i.e. {}).".format(sys.executable)
),
)
parser.add_argument(
"--verbose",
"-v",
default=1,
type=int,
choices=range(3),
help="0 for less logging, 2 for more logging",
)
parser.add_argument("--for-python", "-p", dest="env", type=python_interpreter)
parser.add_argument("--verbose", "-v", default=1, type=int, choices=range(3))
parser.add_argument(
"--version",
action="version",
Expand Down