diff options
author | Ian Stapleton Cordasco <graffatcolmingov@gmail.com> | 2017-11-18 07:38:47 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-18 07:38:47 -0600 |
commit | c631809438660583b7b7f061d9858ff9e9ad27e4 (patch) | |
tree | aeba8f46e60b9c5b8495db1a1416755e83f2c5ee | |
parent | f810ae199e895d4274f527be1dd705fc275a2cb5 (diff) | |
parent | d436d955549ebfc0755e5144230de9e85891c232 (diff) | |
download | pep8-c631809438660583b7b7f061d9858ff9e9ad27e4.tar.gz |
Merge pull request #663 from mjsir911/merge
Allow continuation of verbosity level
-rwxr-xr-x | pycodestyle.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pycodestyle.py b/pycodestyle.py index dc486c8..1b06691 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -2046,8 +2046,9 @@ class StyleGuide(object): # build options from dict options_dict = dict(*args, **kwargs) arglist = None if parse_argv else options_dict.get('paths', None) + verbose = options_dict.get('verbose', None) options, self.paths = process_options( - arglist, parse_argv, config_file, parser) + arglist, parse_argv, config_file, parser, verbose) if options_dict: options.__dict__.update(options_dict) if 'paths' in options_dict: @@ -2307,7 +2308,7 @@ def read_config(options, args, arglist, parser): def process_options(arglist=None, parse_argv=False, config_file=None, - parser=None): + parser=None, verbose=None): """Process options passed either via arglist or via command line args. Passing in the ``config_file`` parameter allows other tools, such as flake8 @@ -2331,6 +2332,10 @@ def process_options(arglist=None, parse_argv=False, config_file=None, (options, args) = parser.parse_args(arglist) options.reporter = None + # If explicity specified verbosity, override any `-v` CLI flag + if verbose is not None: + options.verbose = verbose + if options.ensure_value('testsuite', False): args.append(options.testsuite) elif not options.ensure_value('doctest', False): |