__fish_complete_path: guard against non-matching input

This commit is contained in:
Johannes Altmanninger 2020-12-12 08:22:45 +01:00
parent f0f21bdecd
commit f1478137dc

View file

@ -10,5 +10,8 @@ function __fish_complete_path --description "Complete using path"
set target "$argv[1]"
set description "$argv[2]"
end
printf "%s\t$description\n" (command ls -dp "$target"*)
set -l targets "$target"*
if set -q targets[1]
printf "%s\t$description\n" (command ls -dp $targets)
end
end