From 5ecdcebf8d5e2f02815ea6130cb038f45cf1ad79 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 25 Nov 2021 21:25:46 +0100 Subject: [PATCH] Fix help thinking some docs are commands This looked at __fish_print_commands, which goes via our man pages to find the commands (it shouldn't, buuut), and exludes a hard-coded list of pages. So we do two thigns: 1. We add the other doc pages to the list 2. We check commands *later* - if we listed something explicitly it should be used --- share/functions/__fish_print_commands.fish | 2 +- share/functions/help.fish | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/share/functions/__fish_print_commands.fish b/share/functions/__fish_print_commands.fish index e55bb8aa1..19a393571 100644 --- a/share/functions/__fish_print_commands.fish +++ b/share/functions/__fish_print_commands.fish @@ -3,7 +3,7 @@ function __fish_print_commands --description "Print a list of documented fish co for file in $__fish_data_dir/man/man1/**.1* string replace -r '.*/' '' -- $file | string replace -r '.1(.gz)?$' '' | - string match -rv '^fish-(?:completions|doc|tutorial|faq)$' + string match -rv '^fish-(?:changelog|completions|doc|tutorial|faq|for-bash-users|interactive|language|releasenotes)$' end end end diff --git a/share/functions/help.fish b/share/functions/help.fish index 29b3f054f..dabaea6e8 100644 --- a/share/functions/help.fish +++ b/share/functions/help.fish @@ -128,11 +128,6 @@ function help --description 'Show help for the fish shell' set fish_help_page "cmds/source.html" case globbing set fish_help_page "language.html#expand" - case (builtin -n) (__fish_print_commands) - # If the docs aren't installed, __fish_print_commands won't print anything - # Since we document all our builtins, check those at least. - # The alternative is to create this list at build time. - set fish_help_page "cmds/$fish_help_item.html" case 'completion-*' set fish_help_page "completions.html#$fish_help_item" case 'tut-*' @@ -159,6 +154,11 @@ function help --description 'Show help for the fish shell' set fish_help_page "interactive.html#$fish_help_item" case $tutpages set fish_help_page "tutorial.html#$fish_help_item" + case (builtin -n) (__fish_print_commands) + # If the docs aren't installed, __fish_print_commands won't print anything + # Since we document all our builtins, check those at least. + # The alternative is to create this list at build time. + set fish_help_page "cmds/$fish_help_item.html" case '' set fish_help_page "index.html" case "*"