This patch fixes two things.
1. Do not auto complete obsolete and hidden cmds.
2. sub command completions often failed due to the
use of associative arrays which does not keep the
order. Hence used non-associative arrays.
Fixes: https://tracker.ceph.com/issues/45141
Signed-off-by: Kotresh HR <khiremat@redhat.com>
COMPREPLY=( $(compgen -W "${options_noarg} ${options_arg}" -- $cur) )
return 0
fi
- declare -A hint_args
+ declare -a hint_args
for (( i=1 ; i<cnt ; i++ ))
do
#skip this word if it is option
match_count = 0
comps = []
for cmdtag, cmd in sigdict.items():
+ flags = cmd.get('flags', 0)
+ if flags & (Flag.OBSOLETE | Flag.HIDDEN):
+ continue
sig = cmd['sig']
j = 0
# iterate over all arguments, except last one