2015-10-12 20:47:24 +00:00
|
|
|
PATH=/opt/confluent/bin:$PATH
|
|
|
|
export PATH
|
2017-06-20 18:56:24 +00:00
|
|
|
MANPATH=/opt/confluent/share/man:$MANPATH
|
|
|
|
export MANPATH
|
2017-11-03 20:59:27 +00:00
|
|
|
# The aliases below are to signify that file globbing is unwelcome at the shell
|
|
|
|
# this avoids a problem if a user does a noderange like 'n[21-33] and there is a file
|
|
|
|
# in the directory like 'n3' that causes the parameter to change and target a totally
|
|
|
|
# different node
|
2017-11-13 16:49:40 +00:00
|
|
|
# Unfortunately in bourne shell, we cannot reliably ensure a prepended set-f
|
|
|
|
# and an appended set +f are both run. alias seems to be the only mechanism
|
|
|
|
# that can intervene before glob expansion, but it lacks power.
|
|
|
|
# putting it into a function to append is all well and good, *except* that
|
|
|
|
# if doing something like 'nodepower compute|grep' causes set -f to execute
|
|
|
|
# in current shell, and the function to be in a subshell and leaves globbing
|
|
|
|
# disabled in the parent shell. Instead, store the current command in a
|
|
|
|
# variable and use that to check for misglobbed noderanges, which was the goal
|
|
|
|
alias nodeattrib='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodeattrib'
|
2017-11-14 20:16:58 +00:00
|
|
|
alias nodebmcreset='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodebmcreset'
|
2017-11-13 16:49:40 +00:00
|
|
|
alias nodeboot='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodeboot'
|
2017-11-14 20:16:58 +00:00
|
|
|
alias nodeconfig='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodeconfig'
|
2017-11-13 16:49:40 +00:00
|
|
|
alias nodeconsole='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodeconsole'
|
2020-05-20 20:21:08 +00:00
|
|
|
alias nodedeploy='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodedeploy'
|
2017-11-13 16:49:40 +00:00
|
|
|
alias nodedefine='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodedefine'
|
|
|
|
alias nodeeventlog='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodeeventlog'
|
|
|
|
alias nodefirmware='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodefirmware'
|
|
|
|
alias nodegroupattrib='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodegroupattrib'
|
2017-11-14 21:05:03 +00:00
|
|
|
alias nodegroupdefine='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodegroupdefine'
|
|
|
|
alias nodegroupremove='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodegroupremove'
|
2017-11-13 16:49:40 +00:00
|
|
|
alias nodehealth='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodehealth'
|
|
|
|
alias nodeidentify='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodeidentify'
|
|
|
|
alias nodeinventory='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodeinventory'
|
|
|
|
alias nodelist='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodelist'
|
2018-01-17 15:06:05 +00:00
|
|
|
alias nodemedia='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodemedia'
|
2017-11-13 16:49:40 +00:00
|
|
|
alias nodepower='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodepower'
|
2017-11-14 20:16:58 +00:00
|
|
|
alias noderemove='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; noderemove'
|
2017-11-13 16:49:40 +00:00
|
|
|
alias nodereseat='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodereseat'
|
|
|
|
alias noderun='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; noderun'
|
|
|
|
alias nodesensors='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodesensors'
|
|
|
|
alias nodesetboot='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodesetboot'
|
2021-12-02 19:52:16 +00:00
|
|
|
alias nodestorage='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodestorage -i'
|
2017-11-13 16:49:40 +00:00
|
|
|
alias nodeshell='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodeshell'
|
2019-01-14 21:02:15 +00:00
|
|
|
alias nodelicense='CURRENT_CMDLINE=$(HISTTIMEFORMAT= builtin history 1); export CURRENT_CMDLINE; nodelicense'
|
2019-06-05 18:27:08 +00:00
|
|
|
# Do not continue for non-bash shells, the rest of this sets up bash completion functions
|
|
|
|
[ -z "$BASH_VERSION" -o -z "$PS1" ] && return
|
2018-09-20 20:02:45 +00:00
|
|
|
|
|
|
|
|
2018-09-21 17:54:43 +00:00
|
|
|
_confluent_get_args()
|
|
|
|
{
|
|
|
|
CMPARGS=($COMP_LINE)
|
2019-10-24 19:27:17 +00:00
|
|
|
NUMARGS=$((COMP_CWORD+1))
|
|
|
|
if [ "${COMP_WORDS[COMP_CWORD]}" == '' ]; then
|
2018-10-08 14:47:38 +00:00
|
|
|
CMPARGS+=("")
|
2018-09-21 17:54:43 +00:00
|
|
|
fi
|
2018-10-08 14:47:38 +00:00
|
|
|
GENNED=""
|
|
|
|
for CAND in ${COMP_CANDIDATES[@]}; do
|
|
|
|
candarray=(${CAND//,/ })
|
|
|
|
matched=0
|
|
|
|
for c in "${candarray[@]}"; do
|
|
|
|
for arg in "${CMPARGS[@]}"; do
|
|
|
|
if [ "$arg" = "$c" ]; then
|
|
|
|
matched=1
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
if [ 0 = $matched ]; then
|
|
|
|
for c in "${candarray[@]}"; do
|
|
|
|
GENNED+=" $c"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
done
|
2018-09-21 17:54:43 +00:00
|
|
|
}
|
|
|
|
|
2018-10-08 14:47:38 +00:00
|
|
|
function _confluent_generic_completion()
|
2018-09-21 17:54:43 +00:00
|
|
|
{
|
|
|
|
_confluent_get_args
|
2018-10-08 14:47:38 +00:00
|
|
|
if [ $NUMARGS -ge 3 ] && [ ! -z "$GENNED" ]; then
|
2019-10-24 19:27:17 +00:00
|
|
|
COMPREPLY=($(compgen -W "$GENNED" -- ${COMP_WORDS[COMP_CWORD]}))
|
2018-09-21 17:54:43 +00:00
|
|
|
fi
|
|
|
|
if [ $NUMARGS -lt 3 ]; then
|
|
|
|
_confluent_nr_completion
|
|
|
|
return;
|
|
|
|
fi
|
|
|
|
}
|
2022-12-02 13:23:21 +00:00
|
|
|
function _confluent_generic_ng_completion()
|
|
|
|
{
|
|
|
|
_confluent_get_args
|
|
|
|
if [ $NUMARGS -ge 3 ] && [ ! -z "$GENNED" ]; then
|
|
|
|
COMPREPLY=($(compgen -W "$GENNED" -- ${COMP_WORDS[COMP_CWORD]}))
|
|
|
|
fi
|
|
|
|
if [ $NUMARGS -lt 3 ]; then
|
|
|
|
_confluent_ng_completion
|
|
|
|
return;
|
|
|
|
fi
|
|
|
|
}
|
2018-10-08 14:47:38 +00:00
|
|
|
_confluent_nodeidentify_completion()
|
|
|
|
{
|
2019-08-05 20:22:50 +00:00
|
|
|
COMP_CANDIDATES=("on,off,blink -h")
|
2018-10-08 14:47:38 +00:00
|
|
|
_confluent_generic_completion
|
|
|
|
}
|
2018-09-20 20:02:45 +00:00
|
|
|
|
2018-09-21 18:09:49 +00:00
|
|
|
|
|
|
|
_confluent_nodesetboot_completion()
|
|
|
|
{
|
2021-02-01 13:42:35 +00:00
|
|
|
COMP_CANDIDATES=("default,cd,network,setup,hd,floppy,usb -h -b -p")
|
2018-10-08 14:47:38 +00:00
|
|
|
_confluent_generic_completion
|
2018-09-21 18:09:49 +00:00
|
|
|
}
|
|
|
|
|
2018-09-21 13:57:17 +00:00
|
|
|
_confluent_nodepower_completion()
|
2018-09-20 20:02:45 +00:00
|
|
|
{
|
2018-10-08 14:47:38 +00:00
|
|
|
COMP_CANDIDATES=("boot,off,on,status -h -p")
|
|
|
|
_confluent_generic_completion
|
2018-09-20 20:02:45 +00:00
|
|
|
}
|
2018-09-21 13:57:17 +00:00
|
|
|
|
2018-09-21 18:22:46 +00:00
|
|
|
_confluent_nodemedia_completion()
|
|
|
|
{
|
2018-10-08 14:47:38 +00:00
|
|
|
COMP_CANDIDATES=("list,upload,attach,detachall -h")
|
2018-09-21 18:22:46 +00:00
|
|
|
_confluent_get_args
|
2018-10-02 18:44:25 +00:00
|
|
|
if [ $NUMARGS -gt 3 ] && [ ${CMPARGS[-2]} == 'upload' ]; then
|
2018-09-21 18:22:46 +00:00
|
|
|
compopt -o default
|
|
|
|
COMPREPLY=()
|
|
|
|
return
|
2018-10-02 18:44:25 +00:00
|
|
|
fi
|
2018-10-08 14:47:38 +00:00
|
|
|
if [ $NUMARGS -ge 3 ] && [ ! -z "$GENNED" ]; then
|
2019-10-24 19:27:17 +00:00
|
|
|
COMPREPLY=($(compgen -W "$GENNED" -- ${COMP_WORDS[COMP_CWORD]}))
|
2018-10-02 18:44:25 +00:00
|
|
|
return;
|
2018-09-21 18:22:46 +00:00
|
|
|
fi
|
|
|
|
if [ $NUMARGS -lt 3 ]; then
|
|
|
|
_confluent_nr_completion
|
|
|
|
return;
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-09-21 13:57:17 +00:00
|
|
|
_confluent_nodefirmware_completion()
|
|
|
|
{
|
2018-09-21 17:54:43 +00:00
|
|
|
_confluent_get_args
|
2018-09-21 13:57:17 +00:00
|
|
|
if [ $NUMARGS == 3 ]; then
|
2019-10-24 19:27:17 +00:00
|
|
|
COMPREPLY=($(compgen -W "list update" -- ${COMP_WORDS[COMP_CWORD]}))
|
2018-09-21 13:57:17 +00:00
|
|
|
return;
|
|
|
|
fi
|
|
|
|
if [ $NUMARGS -gt 3 ] && [ ${CMPARGS[2]} == 'update' ]; then
|
|
|
|
compopt -o default
|
|
|
|
COMPREPLY=()
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
if [ $NUMARGS -lt 3 ]; then
|
|
|
|
_confluent_nr_completion
|
|
|
|
return;
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-05-22 13:03:02 +00:00
|
|
|
_confluent_osimage_completion()
|
|
|
|
{
|
|
|
|
_confluent_get_args
|
|
|
|
if [ $NUMARGS == 2 ]; then
|
2024-03-11 17:32:45 +00:00
|
|
|
COMPREPLY=($(compgen -W "initialize import importcheck updateboot rebase" -- ${COMP_WORDS[COMP_CWORD]}))
|
2020-05-22 13:03:02 +00:00
|
|
|
return
|
|
|
|
elif [ ${CMPARGS[1]} == 'initialize' ]; then
|
|
|
|
COMPREPLY=($(compgen -W "-h -u -s -t -i" -- ${COMP_WORDS[COMP_CWORD]}))
|
2024-03-11 17:32:45 +00:00
|
|
|
elif [ ${CMPARGS[1]} == 'import' ] || [ ${CMPARGS[1]} == 'importcheck' ]; then
|
2020-05-22 13:03:02 +00:00
|
|
|
compopt -o default
|
|
|
|
COMPREPLY=()
|
|
|
|
return
|
2022-08-25 19:21:49 +00:00
|
|
|
elif [ ${CMPARGS[1]} == 'updateboot' -o ${CMPARGS[1]} == 'rebase' ]; then
|
2020-08-07 18:12:13 +00:00
|
|
|
COMPREPLY=($(compgen -W "-n $(confetty show /deployment/profiles|sed -e 's/\///')" -- "${COMP_WORDS[COMP_CWORD]}"))
|
|
|
|
return
|
2020-05-22 13:03:02 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2021-06-15 17:30:30 +00:00
|
|
|
_confluent_imgutil_completion()
|
|
|
|
{
|
|
|
|
_confluent_get_args
|
|
|
|
if [ $NUMARGS == 2 ]; then
|
2021-08-10 13:04:30 +00:00
|
|
|
COMPREPLY=($(compgen -W "build exec unpack pack capture" -- ${COMP_WORDS[COMP_CWORD]}))
|
2021-06-15 17:30:30 +00:00
|
|
|
return
|
|
|
|
elif [ ${CMPARGS[1]} == 'build' ]; then
|
|
|
|
COMPREPLY=($(compgen -W "-s $(ls /var/lib/confluent/distributions)" -- ${COMP_WORDS[COMP_CWORD]}))
|
2021-07-26 15:59:04 +00:00
|
|
|
return
|
2021-08-10 13:04:30 +00:00
|
|
|
elif [ ${CMPARGS[1]} == 'unpack' ]; then
|
|
|
|
if [ $NUMARGS == 3 ]; then
|
|
|
|
COMPREPLY=($(compgen -W "-s $(ls /var/lib/confluent/public/os)" -- ${COMP_WORDS[COMP_CWORD]}))
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
compopt -o dirnames
|
|
|
|
return
|
2021-06-15 17:30:30 +00:00
|
|
|
elif [ ${CMPARGS[1]} == 'pack' ]; then
|
2021-07-26 15:59:04 +00:00
|
|
|
if [ $NUMARGS == 3 ]; then
|
|
|
|
compopt -o dirnames
|
|
|
|
fi
|
2021-06-15 17:30:30 +00:00
|
|
|
COMPREPLY=()
|
|
|
|
return
|
2021-07-26 15:59:04 +00:00
|
|
|
elif [ ${CMPARGS[1]} == 'capture' ]; then
|
|
|
|
if [ $NUMARGS == 3 ]; then
|
|
|
|
_confluent_nn_completion
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
return
|
2021-06-15 17:30:30 +00:00
|
|
|
elif [ ${CMPARGS[1]} == 'exec' ]; then
|
|
|
|
compopt -o dirnames
|
2021-07-26 15:59:04 +00:00
|
|
|
COMPREPLY=($(compgen -W "-v" -- ${COMP_WORDS[COMP_CWORD]}))
|
2021-06-15 17:30:30 +00:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
}
|
2020-05-20 20:21:08 +00:00
|
|
|
_confluent_nodedeploy_completion()
|
|
|
|
{
|
|
|
|
_confluent_get_args
|
|
|
|
if [ $NUMARGS -gt 2 ]; then
|
|
|
|
COMPREPLY=($(compgen -W "-n $(confetty show /deployment/profiles|sed -e 's/\///')" -- "${COMP_WORDS[COMP_CWORD]}"))
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
if [ $NUMARGS -lt 3 ]; then
|
|
|
|
_confluent_nr_completion
|
|
|
|
return;
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-10-23 13:09:03 +00:00
|
|
|
_confluent_nodeshell_completion()
|
|
|
|
{
|
|
|
|
_confluent_get_args
|
|
|
|
if [ $NUMARGS == 3 ]; then
|
2019-10-24 19:27:17 +00:00
|
|
|
COMPREPLY=($(compgen -c -- ${COMP_WORDS[COMP_CWORD]}))
|
2018-10-23 13:09:03 +00:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
if [ $NUMARGS -gt 3 ]; then
|
|
|
|
compopt -o default
|
|
|
|
COMPREPLY=()
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
if [ $NUMARGS -lt 3 ]; then
|
|
|
|
_confluent_nr_completion
|
|
|
|
return;
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2019-01-14 21:02:15 +00:00
|
|
|
_confluent_nodelicense_completion()
|
|
|
|
{
|
|
|
|
_confluent_get_args
|
|
|
|
if [ $NUMARGS == 3 ]; then
|
2019-10-24 19:27:17 +00:00
|
|
|
COMPREPLY=($(compgen -W "install list save delete" -- ${COMP_WORDS[COMP_CWORD]}))
|
2019-01-14 21:02:15 +00:00
|
|
|
return;
|
|
|
|
fi
|
|
|
|
if [ $NUMARGS == 4 ] && [ ${CMPARGS[2]} == 'install' ]; then
|
|
|
|
compopt -o default
|
|
|
|
COMPREPLY=()
|
|
|
|
return
|
|
|
|
fi
|
2019-06-19 19:43:45 +00:00
|
|
|
if [ $NUMARGS == 4 ] && [ ${CMPARGS[2]} == 'save' ]; then
|
|
|
|
compopt -o dirnames
|
|
|
|
COMPREPLY=()
|
|
|
|
return
|
|
|
|
fi
|
2019-01-14 21:02:15 +00:00
|
|
|
if [ $NUMARGS -lt 3 ]; then
|
|
|
|
_confluent_nr_completion
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-09-21 13:57:17 +00:00
|
|
|
_confluent_nodesupport_completion()
|
|
|
|
{
|
2018-09-21 17:54:43 +00:00
|
|
|
_confluent_get_args
|
2018-09-21 13:57:17 +00:00
|
|
|
if [ $NUMARGS == 3 ]; then
|
2019-10-24 19:27:17 +00:00
|
|
|
COMPREPLY=($(compgen -W "servicedata" -- ${COMP_WORDS[COMP_CWORD]}))
|
2018-09-21 13:57:17 +00:00
|
|
|
return;
|
|
|
|
fi
|
|
|
|
if [ $NUMARGS == 4 ] && [ ${CMPARGS[2]} == 'servicedata' ]; then
|
|
|
|
compopt -o dirnames
|
|
|
|
COMPREPLY=()
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
if [ $NUMARGS -lt 3 ]; then
|
|
|
|
_confluent_nr_completion
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
}
|
2018-09-20 20:02:45 +00:00
|
|
|
|
2019-04-15 17:38:56 +00:00
|
|
|
_confluent_nodeattrib_completion()
|
|
|
|
{
|
|
|
|
COMP_CANDIDATES=$(nodeattrib '~.>1' all | awk '{print $2}'|sed -e 's/://')
|
|
|
|
_confluent_generic_completion
|
|
|
|
}
|
|
|
|
|
2022-12-02 13:23:21 +00:00
|
|
|
_confluent_define_completion()
|
|
|
|
{
|
|
|
|
COMP_CANDIDATES=$(nodegroupattrib 'everything' all | awk '{print $2}'|sed -e 's/://')
|
|
|
|
_confluent_get_args
|
|
|
|
if [ $NUMARGS -ge 3 ] && [ ! -z "$GENNED" ]; then
|
|
|
|
COMPREPLY=($(compgen -W "$GENNED" -- ${COMP_WORDS[COMP_CWORD]}))
|
|
|
|
fi
|
|
|
|
}
|
2019-04-15 17:38:56 +00:00
|
|
|
|
2022-12-02 13:23:21 +00:00
|
|
|
_confluent_nodegroupattrib_completion()
|
|
|
|
{
|
|
|
|
COMP_CANDIDATES=$(nodegroupattrib 'everything' all | awk '{print $2}'|sed -e 's/://')
|
|
|
|
_confluent_generic_ng_completion
|
|
|
|
}
|
2018-09-20 20:02:45 +00:00
|
|
|
_confluent_nn_completion()
|
|
|
|
{
|
2018-09-21 17:54:43 +00:00
|
|
|
_confluent_get_args
|
2019-10-24 19:27:17 +00:00
|
|
|
INPUT=${COMP_WORDS[COMP_CWORD]}
|
2018-09-20 20:02:45 +00:00
|
|
|
INPUT=${INPUT##*,-}
|
|
|
|
INPUT=${INPUT##*,}
|
|
|
|
INPUT=${INPUT##*@}
|
|
|
|
PREFIX=""
|
2019-10-24 19:27:17 +00:00
|
|
|
if [ "$INPUT" != "${COMP_WORDS[COMP_CWORD]}" ]; then
|
|
|
|
PREFIX=${COMP_WORDS[COMP_CWORD]}
|
2018-09-20 20:02:45 +00:00
|
|
|
PREFIX=$(echo $PREFIX | sed -e 's/,[^,@-]*$/,/' -e 's/,-[^,@]*$/,-/' -e 's/@[^,@]*/@/')
|
|
|
|
fi
|
|
|
|
|
2019-10-24 19:27:17 +00:00
|
|
|
COMPREPLY=($(compgen -W "$(nodelist | sed -e s/^/$PREFIX/)" -- "${COMP_WORDS[COMP_CWORD]}"))
|
2018-09-20 20:02:45 +00:00
|
|
|
}
|
|
|
|
_confluent_nr_completion()
|
|
|
|
{
|
|
|
|
CMPARGS=($COMP_LINE)
|
2018-09-21 17:54:43 +00:00
|
|
|
_confluent_get_args
|
2018-09-20 20:02:45 +00:00
|
|
|
if [ $NUMARGS -gt 2 ]; then
|
2020-07-24 18:35:54 +00:00
|
|
|
compopt -o default
|
|
|
|
COMPREPLY=()
|
2018-09-20 20:02:45 +00:00
|
|
|
return;
|
|
|
|
fi
|
2019-10-24 19:27:17 +00:00
|
|
|
INPUT=${COMP_WORDS[COMP_CWORD]}
|
2018-09-20 20:02:45 +00:00
|
|
|
INPUT=${INPUT##*,-}
|
|
|
|
INPUT=${INPUT##*,}
|
|
|
|
INPUT=${INPUT##*@}
|
|
|
|
PREFIX=""
|
2019-10-24 19:27:17 +00:00
|
|
|
if [ "$INPUT" != "${COMP_WORDS[COMP_CWORD]}" ]; then
|
|
|
|
PREFIX=${COMP_WORDS[COMP_CWORD]}
|
2018-09-20 20:02:45 +00:00
|
|
|
PREFIX=$(echo $PREFIX | sed -e 's/,[^,@-]*$/,/' -e 's/,-[^,@]*$/,-/' -e 's/@[^,@]*/@/')
|
|
|
|
fi
|
|
|
|
|
2019-10-24 19:27:17 +00:00
|
|
|
COMPREPLY=($(compgen -W "$(confetty show /nodegroups|sed -e 's/\///' -e s/^/$PREFIX/;nodelist | sed -e s/^/$PREFIX/)" -- "${COMP_WORDS[COMP_CWORD]}"))
|
2018-09-20 20:02:45 +00:00
|
|
|
}
|
|
|
|
_confluent_ng_completion()
|
|
|
|
{
|
2018-09-21 17:54:43 +00:00
|
|
|
_confluent_get_args
|
2018-09-20 20:02:45 +00:00
|
|
|
if [ $NUMARGS -gt 2 ]; then
|
|
|
|
return;
|
|
|
|
fi
|
2019-10-24 19:27:17 +00:00
|
|
|
INPUT=${COMP_WORDS[COMP_CWORD]}
|
2018-09-20 20:02:45 +00:00
|
|
|
INPUT=${INPUT##*,-}
|
|
|
|
INPUT=${INPUT##*,}
|
|
|
|
INPUT=${INPUT##*@}
|
|
|
|
PREFIX=""
|
2019-10-24 19:27:17 +00:00
|
|
|
if [ "$INPUT" != "${COMP_WORDS[COMP_CWORD]}" ]; then
|
|
|
|
PREFIX=${COMP_WORDS[COMP_CWORD]}
|
2018-09-20 20:02:45 +00:00
|
|
|
PREFIX=$(echo $PREFIX | sed -e 's/,[^,@-]*$/,/' -e 's/,-[^,@]*$/,-/' -e 's/@[^,@]*/@/')
|
|
|
|
fi
|
|
|
|
|
2019-10-24 19:27:17 +00:00
|
|
|
COMPREPLY=($(compgen -W "$(confetty show /nodegroups|sed -e 's/\///' -e s/^/$PREFIX/)" -- "${COMP_WORDS[COMP_CWORD]}"))
|
2018-09-20 20:02:45 +00:00
|
|
|
}
|
2022-12-02 13:23:21 +00:00
|
|
|
|
|
|
|
_confluent_nodediscover_completion()
|
|
|
|
{
|
|
|
|
_confluent_get_args
|
|
|
|
if [ $NUMARGS == 2 ]; then
|
|
|
|
COMPREPLY=($(compgen -W "list assign rescan clear subscribe unsubscribe register" -- ${COMP_WORDS[COMP_CWORD]}))
|
|
|
|
return;
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
complete -F _confluent_nodediscover_completion nodediscover
|
2019-04-15 17:38:56 +00:00
|
|
|
complete -F _confluent_nodeattrib_completion nodeattrib
|
2018-09-20 20:02:45 +00:00
|
|
|
complete -F _confluent_nr_completion nodebmcreset
|
2018-09-21 18:09:49 +00:00
|
|
|
complete -F _confluent_nodesetboot_completion nodeboot
|
2018-09-20 20:02:45 +00:00
|
|
|
complete -F _confluent_nr_completion nodeconfig
|
|
|
|
complete -F _confluent_nn_completion nodeconsole
|
2022-12-02 13:23:21 +00:00
|
|
|
complete -F _confluent_define_completion nodedefine
|
|
|
|
complete -F _confluent_define_completion nodegroupdefine
|
2018-09-20 20:02:45 +00:00
|
|
|
complete -F _confluent_nr_completion nodeeventlog
|
2018-09-21 13:57:17 +00:00
|
|
|
complete -F _confluent_nodefirmware_completion nodefirmware
|
2020-05-20 20:21:08 +00:00
|
|
|
complete -F _confluent_nodedeploy_completion nodedeploy
|
2020-06-25 14:41:58 +00:00
|
|
|
complete -F _confluent_osimage_completion osdeploy
|
2021-06-15 17:30:30 +00:00
|
|
|
complete -F _confluent_imgutil_completion imgutil
|
2022-12-02 13:23:21 +00:00
|
|
|
complete -F _confluent_nodegroupattrib_completion nodegroupattrib
|
2018-09-20 20:02:45 +00:00
|
|
|
complete -F _confluent_ng_completion nodegroupremove
|
|
|
|
complete -F _confluent_nr_completion nodehealth
|
2018-09-21 17:54:43 +00:00
|
|
|
complete -F _confluent_nodeidentify_completion nodeidentify
|
2018-09-20 20:02:45 +00:00
|
|
|
complete -F _confluent_nr_completion nodeinventory
|
2019-07-19 18:22:19 +00:00
|
|
|
complete -F _confluent_nodeattrib_completion nodelist
|
2018-09-21 18:22:46 +00:00
|
|
|
complete -F _confluent_nodemedia_completion nodemedia
|
2018-09-21 13:57:17 +00:00
|
|
|
complete -F _confluent_nodepower_completion nodepower
|
2018-09-20 20:02:45 +00:00
|
|
|
complete -F _confluent_nr_completion noderemove
|
|
|
|
complete -F _confluent_nr_completion nodereseat
|
2018-10-23 13:09:03 +00:00
|
|
|
complete -F _confluent_nodeshell_completion noderun
|
2018-09-20 20:02:45 +00:00
|
|
|
complete -F _confluent_nr_completion nodesensors
|
2018-09-21 18:09:49 +00:00
|
|
|
complete -F _confluent_nodesetboot_completion nodesetboot
|
2018-10-23 13:09:03 +00:00
|
|
|
complete -F _confluent_nodeshell_completion nodeshell
|
2018-09-21 13:57:17 +00:00
|
|
|
complete -F _confluent_nodesupport_completion nodesupport
|
2019-01-14 21:02:15 +00:00
|
|
|
complete -F _confluent_nodelicense_completion nodelicense
|
2018-09-20 20:02:45 +00:00
|
|
|
|