Support the recent changes in the "ejabberdctl help" command (#3569)

pull/3577/head
Badlop 1 year ago
parent 0ec69f0279
commit 4914b33f8c
  1. 13
      tools/ejabberdctl.bc

@ -4,12 +4,15 @@
get_help()
{
local COMMANDCACHE=/var/log/ejabberd/bash_completion_$RANDOM
ejabberdctl $CTLARGS help >$COMMANDCACHE
ejabberdctl $CTLARGS help tags >$COMMANDCACHE.tags
ejabberdctl $CTLARGS >$COMMANDCACHE
if [[ $? == 2 ]] ; then
ISRUNNING=1
runningcommands=`cat $COMMANDCACHE | grep "^ [a-z]" | awk '{print $1}' | xargs`
runningcommands=`cat $COMMANDCACHE | grep "^ [a-z]" | awk '{print $1}' | xargs`
runningtags=`cat $COMMANDCACHE.tags | grep "^ [a-z]" | awk '{print $1}' | xargs`
fi
rm $COMMANDCACHE
rm $COMMANDCACHE.tags
}
_ejabberdctl()
@ -22,8 +25,8 @@ _ejabberdctl()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
local startcoms="start debug live"
local startpars="--config-dir --config --ctl-config --logs --spool"
local startcoms="start foreground foreground-quiet live debug etop iexdebug iexlive ping started stopped"
local startpars="--config-dir --config --ctl-config --logs --node --spool"
local i=1
local CTLARGS=""
@ -55,7 +58,7 @@ _ejabberdctl()
;;
help)
get_help
COMPREPLY=($(compgen -W "${runningcommands}" -- $cur))
COMPREPLY=($(compgen -W "${runningcommands} ${runningtags}" -- $cur))
return 0
;;
--node)

Loading…
Cancel
Save