diff --git a/share/completions/help.fish b/share/completions/help.fish index e284fb138..ac7b11868 100644 --- a/share/completions/help.fish +++ b/share/completions/help.fish @@ -1,6 +1,4 @@ -if test -d "$__fish_data_dir/man/man1/" - complete -c help -x -a '(__fish_print_commands)' -d 'Help for this command' -end +complete -c help -x -a '(__fish_print_commands)' -d 'Help for this command' # Help topics in index.html # This was semi-automated with `grep 'class="anchor"' -A1 /usr/share/doc/fish/index.html diff --git a/share/functions/__fish_print_commands.fish b/share/functions/__fish_print_commands.fish index 8b906f773..0d2112eec 100644 --- a/share/functions/__fish_print_commands.fish +++ b/share/functions/__fish_print_commands.fish @@ -1,14 +1,11 @@ # localization: skip(private) function __fish_print_commands --description "Print a list of documented fish commands" if set -q __fish_data_dir[1] && test -d $__fish_data_dir/man/man1/ - for file in $__fish_data_dir/man/man1/**.1* - string replace -r '.*/' '' -- $file | - string replace -r '.1(.gz)?$' '' | - string match -rv '^fish-(?:changelog|completions|doc|tutorial|faq|for-bash-users|interactive|language|releasenotes|terminal-compatibility)$' - end - end - status list-files man/man1/ 2>/dev/null | + printf %s\n $__fish_data_dir/man/man1/**.1* + else + status list-files man/man1/ 2>/dev/null + end | string replace -r '.*/' '' | string replace -r '.1(.gz)?$' '' | - string match -rv '^fish-(?:changelog|completions|doc|tutorial|faq|for-bash-users|interactive|language|releasenotes)$' + string match -rv '^fish-(?:changelog|completions|doc|tutorial|faq|for-bash-users|interactive|language|releasenotes|terminal-compatibility)$' end