fork/fish-shell

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

Fabian Boehmcompletions/wg-quick: Complete files after the subcommand0aa242655

master
875 B14 linesraw
1set -l valid_subcmds up down strip save
2
3function __fish_wg_complete_interfaces
4    wg show interfaces | string split " " | string replace -r '$' \tInterface
5end
6
7# After a command, this takes a config file.
8complete -c wg-quick -n "not __fish_seen_subcommand_from $valid_subcmds" -f
9
10complete -c wg-quick -n "__fish_seen_subcommand_from $valid_subcmds" -a '(__fish_wg_complete_interfaces)'
11complete -c wg-quick -n "not __fish_seen_subcommand_from $valid_subcmds" -a up -d 'Add and set up an interface'
12complete -c wg-quick -n "not __fish_seen_subcommand_from $valid_subcmds" -a down -d 'Tear down and remove an interface'
13complete -c wg-quick -n "not __fish_seen_subcommand_from $valid_subcmds" -a strip -d 'Output config for use with wg'
14complete -c wg-quick -n "not __fish_seen_subcommand_from $valid_subcmds" -a save -d 'Saves the configuration of an existing interface'