From aa77a52a069e832236495f2aa7bfdbc90f26b59c Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 15 Nov 2014 17:58:38 +1300 Subject: [PATCH] One common --version flag --- libmproxy/cmdline.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/libmproxy/cmdline.py b/libmproxy/cmdline.py index 83aac7906..b892f1fd8 100644 --- a/libmproxy/cmdline.py +++ b/libmproxy/cmdline.py @@ -188,6 +188,11 @@ def get_common_options(options): def common_options(parser): + parser.add_argument( + '--version', + action= 'version', + version= "%(prog)s" + " " + version.VERSION + ) parser.add_argument( "--anticache", action="store_true", dest="anticache", default=False, @@ -530,11 +535,6 @@ def mitmproxy(): add_config_file_help = True, add_env_var_help = True ) - parser.add_argument( - '--version', - action='version', - version=version.NAMEVERSION - ) common_options(parser) parser.add_argument( "--palette", type=str, default="dark", @@ -570,11 +570,6 @@ def mitmdump(): add_env_var_help = True ) - parser.add_argument( - '--version', - action= 'version', - version= "mitmdump" + " " + version.VERSION - ) common_options(parser) parser.add_argument( "--keepserving", @@ -604,11 +599,6 @@ def mitmweb(): add_config_file_help = True, add_env_var_help = True ) - parser.add_argument( - '--version', - action='version', - version="mitmweb" + " " + version.VERSION - ) group = parser.add_argument_group("Mitmweb") group.add_argument(