doc_status.py: Error message for unknown CLI flag, switch shebang to python
This commit is contained in:
parent
bd10a00240
commit
b772f5adc9
1 changed files with 16 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import fnmatch
|
import fnmatch
|
||||||
import os
|
import os
|
||||||
|
@ -297,17 +297,21 @@ input_class_list = []
|
||||||
merged_file = ""
|
merged_file = ""
|
||||||
|
|
||||||
for arg in sys.argv[1:]:
|
for arg in sys.argv[1:]:
|
||||||
if arg.startswith('--'):
|
try:
|
||||||
flags[long_flags[arg[2:]]] = not flags[long_flags[arg[2:]]]
|
if arg.startswith('--'):
|
||||||
elif arg.startswith('-'):
|
flags[long_flags[arg[2:]]] = not flags[long_flags[arg[2:]]]
|
||||||
for f in arg[1:]:
|
elif arg.startswith('-'):
|
||||||
flags[f] = not flags[f]
|
for f in arg[1:]:
|
||||||
elif os.path.isdir(arg):
|
flags[f] = not flags[f]
|
||||||
for f in os.listdir(arg):
|
elif os.path.isdir(arg):
|
||||||
if f.endswith('.xml'):
|
for f in os.listdir(arg):
|
||||||
input_file_list.append(os.path.join(arg, f));
|
if f.endswith('.xml'):
|
||||||
else:
|
input_file_list.append(os.path.join(arg, f));
|
||||||
input_class_list.append(arg)
|
else:
|
||||||
|
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']:
|
||||||
|
|
Loading…
Reference in a new issue