Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b8677b

Browse files
committed
Another minor update for Issue #54
1 parent 47b6e69 commit 8b8677b

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/parse/cmdline.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,11 +672,12 @@ def cmdLineParser():
672672
parser.add_option_group(miscellaneous)
673673

674674
# Dirty hack for making a short option -hh
675-
_ = parser.get_option("--hh")
676-
_._short_opts = ["-hh"]
677-
_._long_opts = []
675+
option = parser.get_option("--hh")
676+
option._short_opts = ["-hh"]
677+
option._long_opts = []
678678

679679
args = []
680+
advancedHelp = True
680681

681682
for arg in sys.argv:
682683
args.append(getUnicode(arg, system=True))
@@ -686,6 +687,7 @@ def cmdLineParser():
686687
if sys.argv[i] == '-hh':
687688
sys.argv[i] = '-h'
688689
elif sys.argv[i] == '-h':
690+
advancedHelp = False
689691
for group in parser.option_groups[:]:
690692
found = False
691693
for option in group.option_list:
@@ -699,7 +701,7 @@ def cmdLineParser():
699701
try:
700702
(args, _) = parser.parse_args(args)
701703
except SystemExit:
702-
if '-h' in sys.argv:
704+
if '-h' in sys.argv and not advancedHelp:
703705
print "\n[!] to see full list of options run with '-hh'"
704706
raise
705707

0 commit comments

Comments
 (0)