completions/wvdial: Use path

This commit is contained in:
Fabian Boehm 2023-04-29 16:15:13 +02:00
parent 2f997ba8a2
commit 0963e6769e

View file

@ -15,15 +15,13 @@ function __fish_complete_wvdial_peers --description 'Complete wvdial peers' --ar
case -C --config case -C --config
set store_next true set store_next true
case '--config=*' case '--config=*'
set cfgfiles (echo $opt | string replace '--config=' '') set cfgfiles (string replace '--config=' '' -- $opt)
end end
end end
for file in $cfgfiles for file in (path filter -rf -- $cfgfiles)
if test -f $file string match -r '\[Dialer' <$file | string replace -r '\[Dialer (.+)\]' '$1'
string match -r '\[Dialer' <$file | string replace -r '\[Dialer (.+)\]' '$1' end | path sort -u | string match -v Defaults
end
end | sort -u | string match -v Defaults
end end