aboutsummaryrefslogtreecommitdiffhomepage
path: root/init
diff options
context:
space:
mode:
authorGravatar Nicholas Pilon <npilon@gmail.com>2006-02-06 08:18:05 +1000
committerGravatar Nicholas Pilon <npilon@gmail.com>2006-02-06 08:18:05 +1000
commitbde5921258c492588f1bda0176fac756245d66d3 (patch)
treed8dcfa6af1583cc754158588b040a2137dbf0049 /init
parent89ae02976f2cffcc721006a7f7be0c667826447e (diff)
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
Diffstat (limited to 'init')
-rw-r--r--init/fish_function.fish2
1 files changed, 1 insertions, 1 deletions
diff --git a/init/fish_function.fish b/init/fish_function.fish
index 73b65be6..3bef671f 100644
--- a/init/fish_function.fish
+++ b/init/fish_function.fish
@@ -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
#