diff options
-rwxr-xr-x | share/tools/create_manpage_completions.py | 14 |
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) |