Revert "__fish_describe_command: print only exact match and exit"

This reverts commit 535845861a.

That commit introduced a bug where tab-completing commands no longer
prints their descriptions, unless there is an exact match.
This commit is contained in:
ridiculousfish 2020-04-30 11:09:46 -07:00
parent 4116829292
commit a1494c9c22

View File

@ -32,11 +32,10 @@ function __fish_describe_command -d "Command used to find descriptions for comma
apropos $argv 2>/dev/null | awk -v FS=" +- +" '{
split($1, names, ", ");
for (name in names)
if (names[name] ~ /^'"$argv_regex"'[^A-z._-]* *\([18]\)/ ) {
if (names[name] ~ /^'"$argv_regex"'.* *\([18]\)/ ) {
sub( "( |\t)*\\\([18]\\\)", "", names[name] );
sub( " \\\[.*\\\]", "", names[name] );
print names[name] "\t" $2;
exit;
}
}'
end