Skip to content

Commit

Permalink
Short aliases for sub-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
AT0myks committed Dec 18, 2023
1 parent 5fc9532 commit b513491
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reolinkfw/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ def main() -> None:
pcache = ArgumentParser(add_help=False)
pcache.add_argument("--no-cache", action="store_true", help="don't use cache for remote files (URLs)")

parser_i = subparsers.add_parser("info", parents=[pcache])
parser_i = subparsers.add_parser("info", parents=[pcache], aliases=['i'])
parser_i.add_argument("file_or_url", help="URL or on-disk file")
parser_i.add_argument("-j", "--json", nargs='?', type=int, const=-1, metavar="indent", help="JSON output with optional indentation level for pretty print")
parser_i.set_defaults(func=info)

descex = "Extract the file system from a Reolink firmware"
parser_e = subparsers.add_parser("extract", parents=[pcache], help=descex.lower(), description=descex)
parser_e = subparsers.add_parser("extract", parents=[pcache], aliases=['e'], help=descex.lower(), description=descex)
parser_e.add_argument("file_or_url", help="URL or on-disk file")
parser_e.add_argument("-d", "--dest", type=Path, help="destination directory. Default: current directory")
parser_e.add_argument("-f", "--force", action="store_true", help="overwrite existing files. Does not apply to UBIFS. Default: %(default)s")
Expand Down

0 comments on commit b513491

Please sign in to comment.