Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #410 from dephell/h-for-help
Browse files Browse the repository at this point in the history
Use `-h` as an alias for `--help`
  • Loading branch information
orsinium committed Mar 18, 2020
2 parents c490f73 + 707d812 commit af3f3ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dephell/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ def main(argv: List[str]) -> int:
if not argv:
parser._print_message(parser.format_help())
return ReturnCodes.OK.value
if len(argv) == 1 and argv[0] in ('--help', 'help', 'commands'):
if len(argv) == 1 and argv[0] in ('--help', '-h', 'help', 'commands'):
parser._print_message(parser.format_help())
return ReturnCodes.OK.value
if len(argv) == 1 and argv[0] in ('-v', '--version'):
argv = ['inspect', 'self']

# rewrite argv to get help about command
if len(argv) >= 1 and argv[0] in ('--help', 'help'):
if len(argv) >= 1 and argv[0] in ('--help', '-h', 'help'):
argv = list(argv[1:]) + ['--help']

# get command
Expand Down

0 comments on commit af3f3ac

Please sign in to comment.