aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/tools
diff options
context:
space:
mode:
authorGravatar Alexander Hedges <ahedges@ethz.ch>2015-11-07 18:25:16 +0100
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-11-08 12:19:15 -0800
commit2bbad22248caafdf839a7229d127287db6be08c4 (patch)
treefaa301ffcf3dfc69cd7048156f26f20b1703d7fe /share/tools
parent22493c9df82ccf20b791fd597e82fdfebea4ca00 (diff)
Remove autogenerated files before generating the new ones
Currently if there is a conflict with two manpages having the same name, one completion will override the other. But if one can be parsed and the other can't the one with parsed results will always have a higher priority.
Diffstat (limited to 'share/tools')
-rwxr-xr-xshare/tools/create_manpage_completions.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/share/tools/create_manpage_completions.py b/share/tools/create_manpage_completions.py
index fe9c52c3..2b0a04c9 100755
--- a/share/tools/create_manpage_completions.py
+++ b/share/tools/create_manpage_completions.py
@@ -817,15 +817,7 @@ def parse_manpage_at_path(manpage_path, output_directory):
parser_names = ', '.join(p.name() for p in parsersToTry)
#add_diagnostic('%s contains no options or is unparsable' % manpage_path, BRIEF_VERBOSE)
add_diagnostic('%s contains no options or is unparsable (tried parser %s)' % (manpage_path, parser_names), BRIEF_VERBOSE)
- # Make sure we delete any old completion
- if not WRITE_TO_STDOUT:
- fullpath = os.path.join(output_directory, CMDNAME + '.fish')
- try:
- os.remove(fullpath)
- except (OSError, IOError):
- # Ignore failure
- pass
-
+
return success
def parse_and_output_man_pages(paths, output_directory, show_progress):
@@ -983,4 +975,8 @@ if __name__ == "__main__":
if e.errno != errno.EEXIST:
raise
+ if not WRITE_TO_STDOUT:
+ # Remove old generated files
+ cleanup_autogenerated_completions_in_directory(output_directory)
+
parse_and_output_man_pages(file_paths, output_directory, show_progress)