diff options
| author | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-07-16 10:07:19 -0500 |
|---|---|---|
| committer | Ian Cordasco <graffatcolmingov@gmail.com> | 2016-07-16 10:07:19 -0500 |
| commit | 73be9b0e90b187dd7e9533cdd0c287a3d40cb1ec (patch) | |
| tree | 7fa7023da26d3f1fdf7763678bcde970a46c9629 /src/flake8/main | |
| parent | 43df3ecf745f2d1a00cdfdf98df5399efb440e9a (diff) | |
| download | flake8-73be9b0e90b187dd7e9533cdd0c287a3d40cb1ec.tar.gz | |
Add OptionManager#parse_known_args
If a user specified `--max-complexity` on the command-line, they
would be told that it did not exist. The same would be true of any
option provided by a plugin. This is because we parse the command-line
arguments twice in Flake8 -- the first time to specify the verbosity
and destination for logging, the second time to actually execute Flake8.
Since plugin options are not registered to start with the first time,
they are not valid options. So when we first parse the options, we should
only attempt to parse the ones which we know about.
Closes #168
Diffstat (limited to 'src/flake8/main')
| -rw-r--r-- | src/flake8/main/application.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/flake8/main/application.py b/src/flake8/main/application.py index c7a9741..febe6c7 100644 --- a/src/flake8/main/application.py +++ b/src/flake8/main/application.py @@ -68,7 +68,7 @@ class Application(object): except ValueError: pass - preliminary_opts, _ = self.option_manager.parse_args(args) + preliminary_opts, _ = self.option_manager.parse_known_args(args) # Set the verbosity of the program flake8.configure_logging(preliminary_opts.verbose, preliminary_opts.output_file) |
