From 0a816acf4fcc5333fdcb05e7228cd466b9207177 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 15 Apr 2019 13:38:56 -0400 Subject: [PATCH] Add completion for attributes in node*attrib Make some of the tedium of the long attribute names bearable through tab completion. --- confluent_client/confluent_env.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/confluent_client/confluent_env.sh b/confluent_client/confluent_env.sh index ebc3d321..13e8ee19 100644 --- a/confluent_client/confluent_env.sh +++ b/confluent_client/confluent_env.sh @@ -190,6 +190,13 @@ _confluent_nodesupport_completion() fi } +_confluent_nodeattrib_completion() +{ + COMP_CANDIDATES=$(nodeattrib '~.>1' all | awk '{print $2}'|sed -e 's/://') + _confluent_generic_completion +} + + _confluent_nn_completion() { _confluent_get_args @@ -250,7 +257,8 @@ _confluent_ng_completion() COMPREPLY=($(compgen -W "$(confetty show /nodegroups|sed -e 's/\///' -e s/^/$PREFIX/)" -- "${COMP_WORDS[-1]}")) } -complete -F _confluent_nr_completion nodeattrib +complete -F _confluent_nodeattrib_completion nodeattrib +complete -F _confluent_nodeattrib_completion nodegroupattrib complete -F _confluent_nr_completion nodebmcreset complete -F _confluent_nodesetboot_completion nodeboot complete -F _confluent_nr_completion nodeconfig