mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Improve --color help with argparse metavar
This commit is contained in:
parent
77a1a29c12
commit
eb6da4ae10
2 changed files with 13 additions and 8 deletions
|
|
@ -79,8 +79,8 @@ def main(argv=None):
|
|||
run_parser.add_argument('hook', nargs='?', help='A single hook-id to run')
|
||||
run_parser.add_argument(
|
||||
'--color', default='auto', type=color.use_color,
|
||||
help='Whether to use color in output. Choices are `always`, `never`'
|
||||
', or `auto`. Defaults to `auto`.',
|
||||
metavar='{' + ','.join(color.COLOR_CHOICES) + '}',
|
||||
help='Whether to use color in output. Defaults to `%(default)s`.',
|
||||
)
|
||||
run_parser.add_argument(
|
||||
'--no-stash', default=False, action='store_true',
|
||||
|
|
@ -91,16 +91,18 @@ def main(argv=None):
|
|||
)
|
||||
run_parser.add_argument(
|
||||
'--origin', '-o',
|
||||
help='The origin branch\'s commit_id when using `git push`.',
|
||||
help="The origin branch's commit_id when using `git push`.",
|
||||
)
|
||||
run_parser.add_argument(
|
||||
'--source', '-s',
|
||||
help='The remote branch\'s commit_id when using `git push`.',
|
||||
help="The remote branch's commit_id when using `git push`.",
|
||||
)
|
||||
run_parser.add_argument(
|
||||
'--allow-unstaged-config', default=False, action='store_true',
|
||||
help='Allow an unstaged config to be present. Note that this will '
|
||||
'be stashed before parsing unless --no-stash is specified.'
|
||||
help=(
|
||||
'Allow an unstaged config to be present. Note that this will '
|
||||
'be stashed before parsing unless --no-stash is specified.'
|
||||
),
|
||||
)
|
||||
run_parser.add_argument(
|
||||
'--hook-stage', choices=('commit', 'push'), default='commit',
|
||||
|
|
@ -117,7 +119,7 @@ def main(argv=None):
|
|||
)
|
||||
|
||||
help = subparsers.add_parser(
|
||||
'help', help='Show help for a specific command.'
|
||||
'help', help='Show help for a specific command.',
|
||||
)
|
||||
help.add_argument('help_cmd', nargs='?', help='Command to show help for.')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue