diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-10-25 21:00:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-25 21:00:46 -0700 |
commit | a0ad0b06a00a017c6277e8183d955ad2d46a5ce5 (patch) | |
tree | 77fea1047afa278a369d885266e79a9201f0aec0 /mitmproxy/tools | |
parent | 145c2892f720300020fdeec8a257c3247c8dff5b (diff) | |
parent | b1bdae3d1cbcf7c4c427cac5163faf75150f4cff (diff) | |
download | mitmproxy-a0ad0b06a00a017c6277e8183d955ad2d46a5ce5.tar.gz mitmproxy-a0ad0b06a00a017c6277e8183d955ad2d46a5ce5.tar.bz2 mitmproxy-a0ad0b06a00a017c6277e8183d955ad2d46a5ce5.zip |
Merge pull request #1669 from mhils/typecheck-options
Typecheck options
Diffstat (limited to 'mitmproxy/tools')
-rw-r--r-- | mitmproxy/tools/cmdline.py | 10 | ||||
-rw-r--r-- | mitmproxy/tools/console/master.py | 3 | ||||
-rw-r--r-- | mitmproxy/tools/dump.py | 1 | ||||
-rw-r--r-- | mitmproxy/tools/web/master.py | 3 |
4 files changed, 10 insertions, 7 deletions
diff --git a/mitmproxy/tools/cmdline.py b/mitmproxy/tools/cmdline.py index 2f9ea15c..55adb7fa 100644 --- a/mitmproxy/tools/cmdline.py +++ b/mitmproxy/tools/cmdline.py @@ -591,7 +591,7 @@ def client_replay(parser): group = parser.add_argument_group("Client Replay") group.add_argument( "-c", "--client-replay", - action="append", dest="client_replay", default=None, metavar="PATH", + action="append", dest="client_replay", default=[], metavar="PATH", help="Replay client requests from a saved file." ) @@ -600,7 +600,7 @@ def server_replay(parser): group = parser.add_argument_group("Server Replay") group.add_argument( "-S", "--server-replay", - action="append", dest="server_replay", default=None, metavar="PATH", + action="append", dest="server_replay", default=[], metavar="PATH", help="Replay server responses from a saved file." ) group.add_argument( @@ -610,7 +610,7 @@ def server_replay(parser): ) group.add_argument( "--server-replay-use-header", - action="append", dest="server_replay_use_headers", type=str, + action="append", dest="server_replay_use_headers", type=str, default=[], help="Request headers to be considered during replay. " "Can be passed multiple times." ) @@ -638,7 +638,7 @@ def server_replay(parser): ) payload.add_argument( "--replay-ignore-payload-param", - action="append", dest="server_replay_ignore_payload_params", type=str, + action="append", dest="server_replay_ignore_payload_params", type=str, default=[], help=""" Request's payload parameters (application/x-www-form-urlencoded or multipart/form-data) to be ignored while searching for a saved flow to replay. @@ -648,7 +648,7 @@ def server_replay(parser): group.add_argument( "--replay-ignore-param", - action="append", dest="server_replay_ignore_params", type=str, + action="append", dest="server_replay_ignore_params", type=str, default=[], help=""" Request's parameters to be ignored while searching for a saved flow to replay. Can be passed multiple times. diff --git a/mitmproxy/tools/console/master.py b/mitmproxy/tools/console/master.py index 909c83da..c128e42b 100644 --- a/mitmproxy/tools/console/master.py +++ b/mitmproxy/tools/console/master.py @@ -203,9 +203,10 @@ class ConsoleState(state.State): class Options(mitmproxy.options.Options): def __init__( self, + *, # all args are keyword-only. eventlog: bool = False, follow: bool = False, - intercept: bool = False, + intercept: Optional[str] = None, filter: Optional[str] = None, palette: Optional[str] = None, palette_transparent: bool = False, diff --git a/mitmproxy/tools/dump.py b/mitmproxy/tools/dump.py index e92482f3..837959bc 100644 --- a/mitmproxy/tools/dump.py +++ b/mitmproxy/tools/dump.py @@ -18,6 +18,7 @@ class DumpError(Exception): class Options(options.Options): def __init__( self, + *, # all args are keyword-only. keepserving: bool = False, filtstr: Optional[str] = None, flow_detail: int = 1, diff --git a/mitmproxy/tools/web/master.py b/mitmproxy/tools/web/master.py index 619582f3..75842422 100644 --- a/mitmproxy/tools/web/master.py +++ b/mitmproxy/tools/web/master.py @@ -94,8 +94,9 @@ class WebState(state.State): class Options(options.Options): def __init__( self, + *, # all args are keyword-only. intercept: Optional[str] = None, - wdebug: bool = bool, + wdebug: bool = False, wport: int = 8081, wiface: str = "127.0.0.1", wauthenticator: Optional[authentication.PassMan] = None, |