|
1 | 1 | from __future__ import unicode_literals |
2 | 2 |
|
3 | 3 | import argparse |
| 4 | +import logging |
4 | 5 | import os |
5 | 6 | import sys |
6 | 7 |
|
|
20 | 21 | from pre_commit.runner import Runner |
21 | 22 |
|
22 | 23 |
|
| 24 | +logger = logging.getLogger('pre_commit') |
| 25 | + |
23 | 26 | # https://github.com/pre-commit/pre-commit/issues/217 |
24 | 27 | # On OSX, making a virtualenv using pyvenv at . causes `virtualenv` and `pip` |
25 | 28 | # to install packages to the wrong place. We don't want anything to deal with |
@@ -117,7 +120,14 @@ def main(argv=None): |
117 | 120 | _add_color_option(autoupdate_parser) |
118 | 121 | _add_config_option(autoupdate_parser) |
119 | 122 | autoupdate_parser.add_argument( |
120 | | - '--tags-only', action='store_true', help='Update to tags only.', |
| 123 | + '--tags-only', action='store_true', help='LEGACY: for compatibility', |
| 124 | + ) |
| 125 | + autoupdate_parser.add_argument( |
| 126 | + '--bleeding-edge', action='store_true', |
| 127 | + help=( |
| 128 | + 'Update to the bleeding edge of `master` instead of the latest ' |
| 129 | + 'tagged version (the default behavior).' |
| 130 | + ), |
121 | 131 | ) |
122 | 132 |
|
123 | 133 | run_parser = subparsers.add_parser('run', help='Run hooks.') |
@@ -209,7 +219,9 @@ def main(argv=None): |
209 | 219 | elif args.command == 'clean': |
210 | 220 | return clean(runner) |
211 | 221 | elif args.command == 'autoupdate': |
212 | | - return autoupdate(runner, args.tags_only) |
| 222 | + if args.tags_only: |
| 223 | + logger.warning('--tags-only is the default') |
| 224 | + return autoupdate(runner, tags_only=not args.bleeding_edge) |
213 | 225 | elif args.command == 'run': |
214 | 226 | return run(runner, args) |
215 | 227 | elif args.command == 'sample-config': |
|
0 commit comments