From 61d1f747ba832e501258ad64c6e6605b97fd1fa3 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Sat, 2 Jan 2021 23:00:37 +0100 Subject: [PATCH] Tools: completion: bash better completion for binaries --- Tools/completion/bash/_ap_bin | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/Tools/completion/bash/_ap_bin b/Tools/completion/bash/_ap_bin index 6ce0f46e78..4240914671 100644 --- a/Tools/completion/bash/_ap_bin +++ b/Tools/completion/bash/_ap_bin @@ -7,37 +7,16 @@ _ap_bin() cur="${COMP_WORDS[COMP_CWORD]}" opts="--help -h" - opts+=" --wipe -w" + opts+=" --wipe -w" opts+=" --unhide-groups -u" - opts+=" --speedup -s SPEEDUP" + opts+=" --speedup -s" opts+=" --rate -r" opts+=" --console -C" opts+=" --instance -I" opts+=" --synthetic-clock -S" opts+=" --home -O" opts+=" --model -M" - opts+=" --config" opts+=" --fg -F" - opts+=" --disable-fgview" - opts+=" --gimbal" - opts+=" --autotest-dir" - opts+=" --defaults" - opts+=" --uartA" - opts+=" --uartB" - opts+=" --uartC" - opts+=" --uartD" - opts+=" --uartE" - opts+=" --uartF" - opts+=" --uartG" - opts+=" --uartH" - opts+=" --uartI" - opts+=" --rtscts" - opts+=" --base-port" - opts+=" --rc-in-port" - opts+=" --sim-address" - opts+=" --sim-port-in" - opts+=" --sim-port-out" - opts+=" --irlock-port" # Prevent word reuse lim=$((COMP_CWORD - 1)) for i in $(seq 0 $lim); do @@ -46,7 +25,7 @@ _ap_bin() opts=${opts//--${COMP_WORDS[i]}/} fi done - COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") $(compgen -W "${opts}" -- ${cur}) ) }