mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 12:36:54 +00:00
options: Forward --output-file to be reparsed for BaseFormatter
This fixes a regression introduced indaca2c8andb14d47b. The --output-file` option was consumed by the preliminary option parser. However, the `BaseFormatter` class needs the option for setting the output filename. This special cases this option to ensure it gets re-parsed and respected when specified on the CLI.
This commit is contained in:
parent
b4d2850192
commit
e6d8a90e5d
2 changed files with 20 additions and 1 deletions
|
|
@ -112,7 +112,12 @@ class Application(object):
|
|||
:rtype:
|
||||
(argparse.Namespace, list)
|
||||
"""
|
||||
return self.prelim_arg_parser.parse_known_args(argv)
|
||||
args, rest = self.prelim_arg_parser.parse_known_args(argv)
|
||||
# XXX (ericvw): Special case "forwarding" the output file option so
|
||||
# that it can be reparsed again for the BaseFormatter.filename.
|
||||
if args.output_file:
|
||||
rest.extend(("--output-file", args.output_file))
|
||||
return args, rest
|
||||
|
||||
def exit(self):
|
||||
# type: () -> None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue