From 2a9edfe26e5e24b04246ffc1864a74f2601e23cd Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 5 Feb 2021 17:19:07 +0100 Subject: [PATCH] help: Better handle builtins when docs aren't installed __fish_print_commands just prints the commands we have man pages for, and help uses that to figure out whether it should link a command or a section. If the docs aren't installed it won't find anything. At least check the builtins, because we document them and it's easy. This probably needs to be added at build time - glob doc_src/cmds/*.rst. --- share/functions/help.fish | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/functions/help.fish b/share/functions/help.fish index 51debe4f3..cd83fb572 100644 --- a/share/functions/help.fish +++ b/share/functions/help.fish @@ -117,7 +117,10 @@ function help --description 'Show help for the fish shell' set fish_help_page "cmds/source.html" case globbing set fish_help_page "index.html#expand" - case (__fish_print_commands) + 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"