Skip to content

Commit

Permalink
CLI help improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
LegenJCdary committed Feb 10, 2022
1 parent 5d8c524 commit b49dff1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ansible_deployer/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,21 @@ def set_logging(log_dir: str, timestamp: str, options: dict):
def parse_options(argv):
"""Generic function to parse options for all commands, we validate if the option was allowed for
specific subcommand outside"""
parser = argparse.ArgumentParser()
parser = argparse.ArgumentParser(add_help=True)

parser.add_argument("subcommand", nargs=1, default=[None], metavar="SUBCOMMAND",
help='Specify command to run. Available commands: run, list, lock, unlock.')
parser.add_argument("--infrastructure", "-i", nargs=1, default=[None], metavar="INFRASTRUCTURE",
help='Specify infrastructure for deploy.')
parser.add_argument("--stage", "-s", nargs=1, default=[None], metavar="STAGE",
help='Specify stage type. Available types are: "testing" and "production".')
parser.add_argument("--commit", "-c", nargs=1, default=[None], metavar="COMMIT", help='Provide '
'commit ID.')
parser.add_argument("--task", "-t", nargs=1, default=[None], metavar='"TASK NAME"',
help='Provide task name in "".')
parser.add_argument("--dry", default=False, action='store_true')
parser.add_argument("--debug", "-d", default=False, action="store_true")
help='Specify stage type. Available types are: "testing" and "prod".')
parser.add_argument("--commit", "-c", nargs=1, default=[None], metavar="COMMIT",
help='Provide commit ID.')
parser.add_argument("--task", "-t", nargs=1, default=[None], metavar='TASK_NAME',
help='Provide task_name.')
parser.add_argument("--dry", "-C", default=False, action='store_true', help='Perform dry run.')
parser.add_argument("--debug", "-d", default=False, action="store_true",
help='Print debug output.')
parser.add_argument("--limit", "-l", nargs=1, default=[None], metavar="[LIMIT]",
help='Limit task execution to specified host.')

Expand Down

0 comments on commit b49dff1

Please sign in to comment.