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
set store_next true
case '--config=*'
set cfgfiles (echo $opt | string replace '--config=' '')
set cfgfiles (string replace '--config=' '' -- $opt)
end
end
for file in $cfgfiles
if test -f $file
string match -r '\[Dialer' <$file | string replace -r '\[Dialer (.+)\]' '$1'
end
end | sort -u | string match -v Defaults
for file in (path filter -rf -- $cfgfiles)
string match -r '\[Dialer' <$file | string replace -r '\[Dialer (.+)\]' '$1'
end | path sort -u | string match -v Defaults
end