help: Add special error for $BROWSER/$fish_help_browser being wrong

This commit is contained in:
Fabian Boehm 2024-12-30 20:46:19 +01:00
parent 13763fa318
commit e715c3e3ff

View file

@ -34,6 +34,10 @@ function help --description 'Show help for the fish shell'
if set -q BROWSER
# User has manually set a preferred browser, so we respect that
echo $BROWSER | read -at fish_browser
if not type -q $fish_browser[1]
printf (_ 'help: %s is not a valid command: %s\n') '$fish_browser' "$fish_browser"
return 2
end
else
# No browser set up, inferring.
# We check a bunch and use the last we find.
@ -93,6 +97,11 @@ function help --description 'Show help for the fish shell'
end
end
end
else
if not type -q $fish_browser[1]
printf (_ 'help: %s is not a valid command: %s\n') '$fish_help_browser' "$fish_browser"
return 2
end
end
# In Cygwin, start the user-specified browser using cygstart,