Show builtin description with whatis_current_token

This commit is contained in:
Gokul Soumya 2020-07-12 00:43:47 +05:30 committed by Johannes Altmanninger
parent e665f9b523
commit 5f782cef7d

View File

@ -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