diff --git a/libmproxy/cmdline.py b/libmproxy/cmdline.py index 728791556..6c0b1ae84 100644 --- a/libmproxy/cmdline.py +++ b/libmproxy/cmdline.py @@ -161,7 +161,6 @@ def get_common_options(options): anticache = options.anticache, anticomp = options.anticomp, client_replay = options.client_replay, - flow_detail = options.flow_detail, kill = options.kill, no_server = options.no_server, refresh_server_playback = not options.norefresh, diff --git a/libmproxy/proxy/primitives.py b/libmproxy/proxy/primitives.py index cbf5b2d84..0fa5273b9 100644 --- a/libmproxy/proxy/primitives.py +++ b/libmproxy/proxy/primitives.py @@ -67,6 +67,6 @@ class AddressPriority(object): class Log: - def __init__(self, msg, level): + def __init__(self, msg, level="info"): self.msg = msg self.level = level \ No newline at end of file diff --git a/mitmdump b/mitmdump index 5c86ffca1..68651f8b0 100755 --- a/mitmdump +++ b/mitmdump @@ -44,11 +44,8 @@ if __name__ == '__main__': print >> sys.stderr, "mitmdump:", v.args[0] sys.exit(1) - - try: - dumpopts = dump.Options(**cmdline.get_common_options(options)) - except cmdline.OptionException, v: - parser.error(v.message) + dumpopts = dump.Options(**cmdline.get_common_options(options)) + dumpopts.flow_detail = options.flow_detail, dumpopts.keepserving = options.keepserving if options.args: diff --git a/mitmproxy b/mitmproxy index 9d6fb3740..f227f2018 100755 --- a/mitmproxy +++ b/mitmproxy @@ -52,10 +52,8 @@ if __name__ == '__main__': print >> sys.stderr, "mitmproxy:", v.args[0] sys.exit(1) - try: - opts = console.Options(**cmdline.get_common_options(options)) - except cmdline.OptionException, v: - parser.error(v.message) + opts = console.Options(**cmdline.get_common_options(options)) + opts.eventlog = options.eventlog opts.intercept = options.intercept opts.debug = options.debug opts.palette = options.palette diff --git a/test/test_dump.py b/test/test_dump.py index b723c3e08..604bc5421 100644 --- a/test/test_dump.py +++ b/test/test_dump.py @@ -56,7 +56,7 @@ class TestDumpMaster: def test_error(self): cs = StringIO() - o = dump.Options(verbosity=1) + o = dump.Options(flow_detail=1) m = dump.DumpMaster(None, o, None, outfile=cs) f = tutils.tflow_err() m.handle_request(f.request) @@ -90,7 +90,7 @@ class TestDumpMaster: with tutils.tmpdir() as t: p = os.path.join(t, "read") self._flowfile(p) - assert "GET" in self._dummy_cycle(0, None, "", verbosity=1, rfile=p) + assert "GET" in self._dummy_cycle(0, None, "", flow_detail=1, rfile=p) tutils.raises( dump.DumpError, self._dummy_cycle, @@ -127,9 +127,9 @@ class TestDumpMaster: def test_basic(self): for i in (1, 2, 3): - assert "GET" in self._dummy_cycle(1, "~s", "", verbosity=i) - assert "GET" in self._dummy_cycle(1, "~s", "\x00\x00\x00", verbosity=i) - assert "GET" in self._dummy_cycle(1, "~s", "ascii", verbosity=i) + assert "GET" in self._dummy_cycle(1, "~s", "", flow_detail=i) + assert "GET" in self._dummy_cycle(1, "~s", "\x00\x00\x00", flow_detail=i) + assert "GET" in self._dummy_cycle(1, "~s", "ascii", flow_detail=i) def test_write(self): with tutils.tmpdir() as d: @@ -150,7 +150,7 @@ class TestDumpMaster: def test_script(self): ret = self._dummy_cycle( 1, None, "", - scripts=[tutils.test_data.path("scripts/all.py")], verbosity=0 + scripts=[tutils.test_data.path("scripts/all.py")], verbosity=1 ) assert "XCLIENTCONNECT" in ret assert "XSERVERCONNECT" in ret