aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Müller2022-10-26 12:32:15 +0200
committerWolfgang Müller2022-10-26 12:49:36 +0200
commit77dc0c04fd0439f2aa216f7c9e385df33a071703 (patch)
treebb4bb1a30c4cbe78142670d4ddc4b78da9ad61b1
parent3bce19d12d93f1b27e7d2f2acbef0926417d5390 (diff)
downloadbosun-77dc0c04fd0439f2aa216f7c9e385df33a071703.tar.gz (sig)
Add completions for the fish shellHEAD1.4.0master
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.
-rw-r--r--contrib/completion/bosun.fish16
1 files changed, 16 insertions, 0 deletions
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)"