One common --version flag

This commit is contained in:
Aldo Cortesi 2014-11-15 17:58:38 +13:00
parent 23a4f159fd
commit aa77a52a06

View File

@ -188,6 +188,11 @@ def get_common_options(options):
def common_options(parser): def common_options(parser):
parser.add_argument(
'--version',
action= 'version',
version= "%(prog)s" + " " + version.VERSION
)
parser.add_argument( parser.add_argument(
"--anticache", "--anticache",
action="store_true", dest="anticache", default=False, action="store_true", dest="anticache", default=False,
@ -530,11 +535,6 @@ def mitmproxy():
add_config_file_help = True, add_config_file_help = True,
add_env_var_help = True add_env_var_help = True
) )
parser.add_argument(
'--version',
action='version',
version=version.NAMEVERSION
)
common_options(parser) common_options(parser)
parser.add_argument( parser.add_argument(
"--palette", type=str, default="dark", "--palette", type=str, default="dark",
@ -570,11 +570,6 @@ def mitmdump():
add_env_var_help = True add_env_var_help = True
) )
parser.add_argument(
'--version',
action= 'version',
version= "mitmdump" + " " + version.VERSION
)
common_options(parser) common_options(parser)
parser.add_argument( parser.add_argument(
"--keepserving", "--keepserving",
@ -604,11 +599,6 @@ def mitmweb():
add_config_file_help = True, add_config_file_help = True,
add_env_var_help = True add_env_var_help = True
) )
parser.add_argument(
'--version',
action='version',
version="mitmweb" + " " + version.VERSION
)
group = parser.add_argument_group("Mitmweb") group = parser.add_argument_group("Mitmweb")
group.add_argument( group.add_argument(