doc_status.py: Error message for unknown CLI flag, switch shebang to python

This commit is contained in:
mhilbrunner 2017-10-07 14:57:04 +02:00
parent bd10a00240
commit b772f5adc9

View file

@ -1,4 +1,4 @@
#!/usr/bin/env python3 #!/usr/bin/env python
import fnmatch import fnmatch
import os import os
@ -297,6 +297,7 @@ input_class_list = []
merged_file = "" merged_file = ""
for arg in sys.argv[1:]: for arg in sys.argv[1:]:
try:
if arg.startswith('--'): if arg.startswith('--'):
flags[long_flags[arg[2:]]] = not flags[long_flags[arg[2:]]] flags[long_flags[arg[2:]]] = not flags[long_flags[arg[2:]]]
elif arg.startswith('-'): elif arg.startswith('-'):
@ -308,6 +309,9 @@ for arg in sys.argv[1:]:
input_file_list.append(os.path.join(arg, f)); input_file_list.append(os.path.join(arg, f));
else: else:
input_class_list.append(arg) input_class_list.append(arg)
except KeyError:
print("Unknown command line flag: " + arg)
sys.exit(1)
if flags['i']: if flags['i']:
for r in ['methods', 'constants', 'members', 'signals']: for r in ['methods', 'constants', 'members', 'signals']: