2020-09-19 17:39:51 +08:00
|
|
|
function __fish_complete_wvdial_peers --description 'Complete wvdial peers' --argument-names cfgfiles
|
2020-05-15 13:56:06 +08:00
|
|
|
set -q cfgfiles[1]
|
2019-11-30 20:06:44 +08:00
|
|
|
or set -l cfgfiles /etc/wvdial.conf ~/.wvdialrc
|
|
|
|
|
|
|
|
# test if there is an alternative config file specified
|
|
|
|
set -l store_next
|
|
|
|
for opt in (commandline -cpo)
|
|
|
|
if set -q store_next[1]
|
|
|
|
set store_next
|
|
|
|
set cfgfiles $opt
|
|
|
|
continue
|
|
|
|
end
|
|
|
|
|
|
|
|
switch $opt
|
|
|
|
case -C --config
|
|
|
|
set store_next true
|
|
|
|
case '--config=*'
|
2023-04-29 22:15:13 +08:00
|
|
|
set cfgfiles (string replace '--config=' '' -- $opt)
|
2019-11-30 20:06:44 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-04-29 22:15:13 +08:00
|
|
|
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
|
2019-11-30 20:06:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2017-10-12 01:17:35 +08:00
|
|
|
complete -c wvdial -xa "(__fish_complete_wvdial_peers)" -d "wvdial connections"
|
2012-06-16 08:30:10 +08:00
|
|
|
complete -c wvdial -s c -l chat -d 'Run wvdial as chat replacement from within pppd'
|
|
|
|
complete -c wvdial -s C -l config -r -d 'Run wvdial with alternative config file'
|
|
|
|
complete -c wvdial -s n -l no-syslog -d 'Don\'t output debug information'
|