From 77dc0c04fd0439f2aa216f7c9e385df33a071703 Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Wed, 26 Oct 2022 12:32:15 +0200 Subject: Add completions for the fish shell bosun manages role names that are user-defined and may be hard to remember or annoying to type out. Supporting auto-complete frameworks in modern shells is an obvious improvement. For now only support the fish shell since we use that on all our systems. --- contrib/completion/bosun.fish | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 contrib/completion/bosun.fish diff --git a/contrib/completion/bosun.fish b/contrib/completion/bosun.fish new file mode 100644 index 0000000..7d3e72d --- /dev/null +++ b/contrib/completion/bosun.fish @@ -0,0 +1,16 @@ +set -l commands add flush list rebuild remove +complete -c bosun -f + +complete -c bosun -n "not __fish_seen_subcommand_from $commands" -a add -d "Activate the given roles" +complete -c bosun -n "not __fish_seen_subcommand_from $commands" -a flush -d "Deactivate all active roles" +complete -c bosun -n "not __fish_seen_subcommand_from $commands" -a list -d "List roles of the given type" +complete -c bosun -n "not __fish_seen_subcommand_from $commands" -a rebuild -d "Reactivate the given roles" +complete -c bosun -n "not __fish_seen_subcommand_from $commands" -a remove -d "Deactivate the given roles" + +complete -c bosun -n "__fish_seen_subcommand_from add" -a "(bosun list available)" +complete -c bosun -n "__fish_seen_subcommand_from list" -a active -d "List roles that are active" +complete -c bosun -n "__fish_seen_subcommand_from list" -a all -d "List all roles" +complete -c bosun -n "__fish_seen_subcommand_from list" -a available -d "List roles that are not active on the system" + +complete -c bosun -n "__fish_seen_subcommand_from rebuild" -a "(bosun list active)" +complete -c bosun -n "__fish_seen_subcommand_from remove" -a "(bosun list active)" -- cgit v1.2.3-2-gb3c3