Skip to content

Commit

Permalink
completions/wg-quick: Complete files after the subcommand
Browse files Browse the repository at this point in the history
Fixes #10366
  • Loading branch information
faho committed Mar 12, 2024
1 parent a64a50d commit 0aa2426
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions share/completions/wg-quick.fish
@@ -1,10 +1,12 @@
set -l valid_subcmds up down strip save

function __fish_wg_complete_interfaces
wg show interfaces | string split " "
wg show interfaces | string split " " | string replace -r '$' \tInterface
end

complete -c wg-quick -f
# After a command, this takes a config file.
complete -c wg-quick -n "not __fish_seen_subcommand_from $valid_subcmds" -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'
Expand Down

0 comments on commit 0aa2426

Please sign in to comment.