mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 03:32:27 +08:00
create_manpage_completions.py: refactor: clean up parse_manpage_at_path
This commit is contained in:
parent
75f93a590e
commit
d1ad143cf1
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user