From d52c69af81f1cc580b93d56c4c263e503ad7771d Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Sat, 2 Jan 2021 21:38:44 +0100 Subject: [PATCH] Tools: completion: bash better completions for sim_vehicle.py --- Tools/completion/bash/_sim_vehicle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tools/completion/bash/_sim_vehicle b/Tools/completion/bash/_sim_vehicle index 8b1d63a815..e387719215 100644 --- a/Tools/completion/bash/_sim_vehicle +++ b/Tools/completion/bash/_sim_vehicle @@ -5,6 +5,8 @@ _sim_vehicle() { COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD - 1]}" + # don't complet = + _init_completion -n = || return # TODO: generate for waf help opts="--help -h" @@ -87,7 +89,8 @@ _sim_vehicle() { ;; esac - COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") $(compgen -W "${opts}" -- ${cur}) ) + [[ ${COMPREPLY-} == *= ]] && compopt -o nospace } complete -F _sim_vehicle sim_vehicle.py