fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Fabian BoehmReformat share/**.fish with newlines collapsed78c948282

master
1.1 KiB31 linesraw
1function __fish_complete_wvdial_peers --description 'Complete wvdial peers' --argument-names cfgfiles
2    set -q cfgfiles[1]
3    or set -l cfgfiles /etc/wvdial.conf ~/.wvdialrc
4
5    # test if there is an alternative config file specified
6    set -l store_next
7    for opt in (commandline -cpx)
8        if set -q store_next[1]
9            set store_next
10            set cfgfiles $opt
11            continue
12        end
13
14        switch $opt
15            case -C --config
16                set store_next true
17            case '--config=*'
18                set cfgfiles (string replace '--config=' '' -- $opt)
19        end
20    end
21
22    for file in (path filter -rf -- $cfgfiles)
23        string match -r '\[Dialer' <$file | string replace -r '\[Dialer (.+)\]' '$1'
24    end | path sort -u | string match -v Defaults
25
26end
27
28complete -c wvdial -xa "(__fish_complete_wvdial_peers)" -d "wvdial connections"
29complete -c wvdial -s c -l chat -d 'Run wvdial as chat replacement from within pppd'
30complete -c wvdial -s C -l config -r -d 'Run wvdial with alternative config file'
31complete -c wvdial -s n -l no-syslog -d 'Don\'t output debug information'