From 12d2b1f926bedfb334ce625aad2e85c53e65f481 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Wed, 3 Aug 2011 13:20:36 +1200 Subject: Rip out old script interface, start replacing with new stubs. Scripts are broken for now. --- libmproxy/cmdline.py | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'libmproxy/cmdline.py') diff --git a/libmproxy/cmdline.py b/libmproxy/cmdline.py index 5f51b854..8be419a6 100644 --- a/libmproxy/cmdline.py +++ b/libmproxy/cmdline.py @@ -25,9 +25,8 @@ def get_common_options(options): refresh_server_playback = not options.norefresh, rheaders = options.rheaders, rfile = options.rfile, - request_script = options.request_script, - response_script = options.response_script, server_replay = options.server_replay, + script = options.script, stickycookie = stickycookie, stickyauth = stickyauth, wfile = options.wfile, @@ -41,6 +40,16 @@ def common_options(parser): action="store", type = "str", dest="addr", default='', help = "Address to bind proxy to (defaults to all interfaces)" ) + parser.add_option( + "--anticache", + action="store_true", dest="anticache", default=False, + help="Strip out request headers that might cause the server to return 304-not-modified." + ) + parser.add_option( + "--confdir", + action="store", type = "str", dest="confdir", default='~/.mitmproxy', + help = "Configuration directory. (~/.mitmproxy)" + ) parser.add_option( "-d", action="store_true", dest="autodecode", @@ -51,11 +60,6 @@ def common_options(parser): action="store_true", dest="eventlog", help="Show event log." ) - parser.add_option( - "--confdir", - action="store", type = "str", dest="confdir", default='~/.mitmproxy', - help = "Configuration directory. (~/.mitmproxy)" - ) parser.add_option( "-n", action="store_true", dest="no_server", @@ -77,19 +81,9 @@ def common_options(parser): help="Read flows from file." ) parser.add_option( - "--anticache", - action="store_true", dest="anticache", default=False, - help="Strip out request headers that might cause the server to return 304-not-modified." - ) - parser.add_option( - "--reqscript", - action="store", dest="request_script", default=None, - help="Script to run when a request is recieved." - ) - parser.add_option( - "--respscript", - action="store", dest="response_script", default=None, - help="Script to run when a response is recieved." + "-s", + action="store", dest="script", default=None, + help="Run a script." ) parser.add_option( "-t", @@ -143,7 +137,7 @@ def common_options(parser): group = optparse.OptionGroup(parser, "Server Replay") group.add_option( - "-s", + "-S", action="store", dest="server_replay", default=None, metavar="PATH", help="Replay server responses from a saved file." ) -- cgit v1.2.3