From 0aa24265520a8e3208e24ac4da802992f92e9683 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Tue, 12 Mar 2024 17:31:53 +0100 Subject: [PATCH] completions/wg-quick: Complete files after the subcommand Fixes #10366 --- share/completions/wg-quick.fish | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/completions/wg-quick.fish b/share/completions/wg-quick.fish index 9ca1af38e..cb016f460 100644 --- a/share/completions/wg-quick.fish +++ b/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'