mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-19 13:12:45 +08:00
Describe Command awk-ification
Changed __fish_describe_command to use awk instead of sed, and handle 'alternative' names, as used by OS X. (And possibly some BSDs?) darcs-hash:20060205221805-494f2-85a48edd8e6fbcfc1dcd28079e4adfa52a0466d0.gz
This commit is contained in:
parent
89ae02976f
commit
bde5921258
|
@ -252,7 +252,7 @@ end
|
|||
#
|
||||
|
||||
function __fish_describe_command -d "Command used to find descriptions for commands"
|
||||
apropos $argv | sed -ne "s/^$argv\([^ ]*\) *([18]) *- \(.*\)\$/$argv\1"\t"\2/p"
|
||||
apropos $argv | awk -v FS=" +- +" '{split($1, names, ", "); for (name in names) if (names[name] ~ /^'"$argv"'.* *\([18]\)/) { sub("\\([18]\\)", "", names[name]); print names[name] "\t" $2; } }'
|
||||
end
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue
Block a user