diff --git a/share/tools/create_manpage_completions.py b/share/tools/create_manpage_completions.py index 75ae89773..f8079f54b 100755 --- a/share/tools/create_manpage_completions.py +++ b/share/tools/create_manpage_completions.py @@ -748,7 +748,21 @@ def cleanup_autogenerated_file(path): def parse_manpage_at_path(manpage_path, output_directory): - filename = os.path.basename(manpage_path) + # Return if CMDNAME is in 'ignoredcommands' + ignoredcommands = [ + "cc", + "g++", + "gcc", + "c++", + "cpp", + "emacs", + "gprof", + "wget", + "ld", + "awk", + ] + if CMDNAME in ignoredcommands: + return # Clear diagnostics global diagnostic_indent @@ -788,27 +802,10 @@ def parse_manpage_at_path(manpage_path, output_directory): manpage = str(manpage) - # Get the "base" command, e.g. gcc.1.gz -> gcc - cmd_base = CMDNAME.split(".", 1)[0] - ignoredcommands = [ - "cc", - "g++", - "gcc", - "c++", - "cpp", - "emacs", - "gprof", - "wget", - "ld", - "awk", - ] - if cmd_base in ignoredcommands: - return - # Ignore perl's gazillion man pages ignored_prefixes = ["perl", "zsh"] for prefix in ignored_prefixes: - if cmd_base.startswith(prefix): + if CMDNAME.startswith(prefix): return # Ignore the millions of links to BUILTIN(1)