2006-02-08 18:20:43 +08:00
|
|
|
#
|
|
|
|
# This function is used internally by the fish command completion code
|
|
|
|
#
|
|
|
|
|
|
|
|
function __fish_describe_command -d "Command used to find descriptions for commands"
|
2016-11-28 13:27:22 +08:00
|
|
|
apropos $argv ^/dev/null | awk -v FS=" +- +" '{
|
2006-02-08 18:20:43 +08:00
|
|
|
split($1, names, ", ");
|
|
|
|
for (name in names)
|
2006-03-10 22:28:08 +08:00
|
|
|
if (names[name] ~ /^'"$argv"'.* *\([18]\)/ ) {
|
|
|
|
sub( "( |\t)*\\\([18]\\\)", "", names[name] );
|
2007-01-07 22:20:00 +08:00
|
|
|
sub( " \\\[.*\\\]", "", names[name] );
|
2006-02-08 18:20:43 +08:00
|
|
|
print names[name] "\t" $2;
|
|
|
|
}
|
|
|
|
}'
|
|
|
|
end
|
|
|
|
|