mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 18:18:25 +00:00
warn users if rfile == outfile, refs #1117
This commit is contained in:
parent
e6c2e012a5
commit
c160a47e51
@ -165,6 +165,18 @@ def get_common_options(options):
|
||||
raise configargparse.ArgumentTypeError(e.message)
|
||||
setheaders.append(p)
|
||||
|
||||
if options.outfile and options.outfile[0] == options.rfile:
|
||||
if options.outfile[1] == "wb":
|
||||
raise configargparse.ArgumentTypeError(
|
||||
"Cannot use '{}' for both reading and writing flows. "
|
||||
"Are you looking for --afile?".format(options.rfile)
|
||||
)
|
||||
else:
|
||||
raise configargparse.ArgumentTypeError(
|
||||
"Cannot use '{}' for both reading and appending flows. "
|
||||
"That would trigger an infinite loop."
|
||||
)
|
||||
|
||||
return dict(
|
||||
app=options.app,
|
||||
app_host=options.app_host,
|
||||
|
Loading…
Reference in New Issue
Block a user