mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Add ability to pass filenames as arguments.
This commit is contained in:
parent
cfd86d5faa
commit
d8d7893cf7
3 changed files with 23 additions and 6 deletions
|
|
@ -55,10 +55,6 @@ def main(argv=None):
|
|||
|
||||
run_parser = subparsers.add_parser('run', help='Run hooks.')
|
||||
run_parser.add_argument('hook', nargs='?', help='A single hook-id to run')
|
||||
run_parser.add_argument(
|
||||
'--all-files', '-a', action='store_true', default=False,
|
||||
help='Run on all the files in the repo. Implies --no-stash.',
|
||||
)
|
||||
run_parser.add_argument(
|
||||
'--color', default='auto', type=color.use_color,
|
||||
help='Whether to use color in output. Defaults to `auto`',
|
||||
|
|
@ -70,6 +66,14 @@ def main(argv=None):
|
|||
run_parser.add_argument(
|
||||
'--verbose', '-v', action='store_true', default=False,
|
||||
)
|
||||
run_mutex_group = run_parser.add_mutually_exclusive_group(required=False)
|
||||
run_mutex_group.add_argument(
|
||||
'--all-files', '-a', action='store_true', default=False,
|
||||
help='Run on all the files in the repo. Implies --no-stash.',
|
||||
)
|
||||
run_mutex_group.add_argument(
|
||||
'--files', nargs='*', help='Specific filenames to run hooks on.',
|
||||
)
|
||||
|
||||
help = subparsers.add_parser(
|
||||
'help', help='Show help for a specific command.'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue