Fix apropos completions

The 'str' variable was apparently mistakenly removed by 49c5f96470.

Re-add it, and regex-escape it as well.

Allow completing on apropos <TAB> instaed of requiring an initial char.

Use __fish_apropos instead of apropos.

New regex to hopefully work on more platforms.

Explicitly use ^ instead of adding it at __fish_apropos
This commit is contained in:
Aaron Gyes
2022-10-28 09:39:43 -07:00
parent 054d0ac0ea
commit c887e5dbde
4 changed files with 12 additions and 11 deletions

View File

@@ -36,7 +36,7 @@ if test $status -eq 0 -a (count $sysver) -eq 3
set age (path mtime -R -- $whatis)
end
MANPATH="$dir" apropos "^$argv"
MANPATH="$dir" apropos "$argv"
if test $age -ge $max_age
test -d "$dir" || mkdir -m 700 -p $dir
@@ -46,6 +46,8 @@ if test $status -eq 0 -a (count $sysver) -eq 3
end
else
function __fish_apropos
apropos $argv
# we only ever prefix match for completions. This also ensures results for bare apropos <TAB>
# (apropos '' gives no results, but apropos '^' lists all manpages)
apropos "$argv"
end
end