help function: special case string xxx

This commit is contained in:
Jason Nader 2020-03-21 23:40:14 +09:00 committed by Fabian Homborg
parent 0844bcfef1
commit 979d3a18aa

View File

@ -1,6 +1,6 @@
function help --description 'Show help for the fish shell'
set -l options h/help
argparse -n help --max-args=1 $options -- $argv
argparse -n help $options -- $argv
or return
if set -q _flag_help
@ -9,6 +9,15 @@ function help --description 'Show help for the fish shell'
end
set -l fish_help_item $argv[1]
if test (count $argv) -gt 1
if string match -q string $argv[1]
set fish_help_item (string join '-' $argv[1] $argv[2])
else
echo "help: Expected at most 1 args, got 2"
return 1
end
end
set -l help_topics syntax completion editor job-control todo bugs history killring help
set -a help_topics color prompt title variables builtin-overview changes expand
set -a help_topics expand-variable expand-home expand-brace expand-wildcard