mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-26 03:35:17 +00:00
help: Add special error for $BROWSER/$fish_help_browser being wrong
This commit is contained in:
parent
13763fa318
commit
e715c3e3ff
1 changed files with 9 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue