Another minor update for Issue #54

This commit is contained in:
Miroslav Stampar 2012-07-03 12:29:42 +02:00
parent 47b6e696d8
commit 8b8677b938

View File

@ -672,11 +672,12 @@ def cmdLineParser():
parser.add_option_group(miscellaneous) parser.add_option_group(miscellaneous)
# Dirty hack for making a short option -hh # Dirty hack for making a short option -hh
_ = parser.get_option("--hh") option = parser.get_option("--hh")
_._short_opts = ["-hh"] option._short_opts = ["-hh"]
_._long_opts = [] option._long_opts = []
args = [] args = []
advancedHelp = True
for arg in sys.argv: for arg in sys.argv:
args.append(getUnicode(arg, system=True)) args.append(getUnicode(arg, system=True))
@ -686,6 +687,7 @@ def cmdLineParser():
if sys.argv[i] == '-hh': if sys.argv[i] == '-hh':
sys.argv[i] = '-h' sys.argv[i] = '-h'
elif sys.argv[i] == '-h': elif sys.argv[i] == '-h':
advancedHelp = False
for group in parser.option_groups[:]: for group in parser.option_groups[:]:
found = False found = False
for option in group.option_list: for option in group.option_list:
@ -699,7 +701,7 @@ def cmdLineParser():
try: try:
(args, _) = parser.parse_args(args) (args, _) = parser.parse_args(args)
except SystemExit: except SystemExit:
if '-h' in sys.argv: if '-h' in sys.argv and not advancedHelp:
print "\n[!] to see full list of options run with '-hh'" print "\n[!] to see full list of options run with '-hh'"
raise raise