mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 00:44:53 +08:00
Show builtin description with whatis_current_token
This commit is contained in:
parent
e665f9b523
commit
5f782cef7d
@ -10,13 +10,16 @@ function __fish_whatis_current_token -d "Show man page entries or function descr
|
||||
set -l tokentype (type --type $token 2>/dev/null)
|
||||
|
||||
switch "$tokentype"
|
||||
case "function"
|
||||
case function
|
||||
set -l funcinfo (functions $token --details --verbose)
|
||||
|
||||
test $funcinfo[5] != "n/a"
|
||||
test $funcinfo[5] != n/a
|
||||
and set desc "$token - $funcinfo[5]"
|
||||
|
||||
case "file"
|
||||
case builtin
|
||||
set desc (__fish_print_help $token | awk "/./ {print; exit}")
|
||||
|
||||
case file
|
||||
set -l tmpdesc (whatis $token 2>/dev/null)
|
||||
and set desc $tmpdesc
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user