From 5b7807fe3d460dde90314e80b4d8e46e473caf56 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 14 Jan 2019 16:02:15 -0500 Subject: [PATCH] Add nodelicense command This provides Bash access to the license management features. --- confluent_client/confluent_env.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/confluent_client/confluent_env.sh b/confluent_client/confluent_env.sh index 3ca671ad..ebc3d321 100644 --- a/confluent_client/confluent_env.sh +++ b/confluent_client/confluent_env.sh @@ -38,6 +38,7 @@ alias nodesensors='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export alias nodesetboot='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodesetboot' alias nodestorage='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodestorage' alias nodeshell='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodeshell' +alias nodelicense='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodelicense' _confluent_get_args() @@ -153,6 +154,24 @@ _confluent_nodeshell_completion() fi } +_confluent_nodelicense_completion() +{ + _confluent_get_args + if [ $NUMARGS == 3 ]; then + COMPREPLY=($(compgen -W "install list" -- ${COMP_WORDS[-1]})) + return; + fi + if [ $NUMARGS == 4 ] && [ ${CMPARGS[2]} == 'install' ]; then + compopt -o default + COMPREPLY=() + return + fi + if [ $NUMARGS -lt 3 ]; then + _confluent_nr_completion + return + fi +} + _confluent_nodesupport_completion() { _confluent_get_args @@ -253,4 +272,5 @@ complete -F _confluent_nr_completion nodesensors complete -F _confluent_nodesetboot_completion nodesetboot complete -F _confluent_nodeshell_completion nodeshell complete -F _confluent_nodesupport_completion nodesupport +complete -F _confluent_nodelicense_completion nodelicense