fish-shell/share/completions/wg-quick.fish
Jason Nader d655f40d43 completions: fix wg-quick interface completions
wg outputs space separated list

(cherry picked from commit 28d9f1878d)
2024-03-18 22:34:55 +08:00

12 lines
741 B
Fish

set -l valid_subcmds up down strip save
function __fish_wg_complete_interfaces
wg show interfaces | string split " "
end
complete -c wg-quick -f
complete -c wg-quick -n "__fish_seen_subcommand_from $valid_subcmds" -a '(__fish_wg_complete_interfaces)'
complete -c wg-quick -n "not __fish_seen_subcommand_from $valid_subcmds" -a up -d 'Add and set up an interface'
complete -c wg-quick -n "not __fish_seen_subcommand_from $valid_subcmds" -a down -d 'Tear down and remove an interface'
complete -c wg-quick -n "not __fish_seen_subcommand_from $valid_subcmds" -a strip -d 'Output config for use with wg'
complete -c wg-quick -n "not __fish_seen_subcommand_from $valid_subcmds" -a save -d 'Saves the configuration of an existing interface'