diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-10-09 14:52:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-09 14:52:11 +0200 |
commit | cbeeba9c0346517801a7610154cd85955d542919 (patch) | |
tree | 79f68381b08cc0576b56a4e97bc3ad3238d08706 | |
parent | 8ddbd1977793ef1318d3557001310c59277321d0 (diff) | |
parent | b772f5adc9bd9384994bdf60ac4d0285c47bc3e2 (diff) |
Merge pull request #11908 from mhilbrunner/docstatus-flagerror
doc_status.py: Error message for unknown CLI flag, shebang change
[ci skip]
-rw-r--r-- | doc/tools/doc_status.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/doc/tools/doc_status.py b/doc/tools/doc_status.py index 6b936899d8..e89b49eb4d 100644 --- a/doc/tools/doc_status.py +++ b/doc/tools/doc_status.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python import fnmatch import os @@ -297,17 +297,21 @@ input_class_list = [] merged_file = "" for arg in sys.argv[1:]: - if arg.startswith('--'): - flags[long_flags[arg[2:]]] = not flags[long_flags[arg[2:]]] - elif arg.startswith('-'): - for f in arg[1:]: - flags[f] = not flags[f] - elif os.path.isdir(arg): - for f in os.listdir(arg): - if f.endswith('.xml'): - input_file_list.append(os.path.join(arg, f)); - else: - input_class_list.append(arg) + try: + if arg.startswith('--'): + flags[long_flags[arg[2:]]] = not flags[long_flags[arg[2:]]] + elif arg.startswith('-'): + for f in arg[1:]: + flags[f] = not flags[f] + elif os.path.isdir(arg): + for f in os.listdir(arg): + if f.endswith('.xml'): + input_file_list.append(os.path.join(arg, f)); + else: + input_class_list.append(arg) + except KeyError: + print("Unknown command line flag: " + arg) + sys.exit(1) if flags['i']: for r in ['methods', 'constants', 'members', 'signals']: |