mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 04:41:14 -03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user