diff --git a/test_complete.sh b/test_complete.sh index 08df3d674286629d55762c4af3bab18370535500..cdc8b614166e0000af76fc0fcd0c70d3cc31166c 100644 --- a/test_complete.sh +++ b/test_complete.sh @@ -4,7 +4,8 @@ _validate_workflow_completion() { COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" - opts=$(grep -rE "^#hh\s+-., --[a-z]+" "${SELF}" | sed -e "s/^#hh.*\(-.\), \(--[a-z-]*\).*/\1 \2/g") + # parse get_cli_args() function, extract list of CLI options and discard the rest + opts="$( type get_cli_args | grep -E -v "^[{}]" | grep -v "get_cli_args" | grep -E "^\s+-.|--[a-z]+)" | sed -e "s/^\s*\(-.\) | \(--[a-z-]*\).*/\1 \2/g" )" 2>&1 echo "OPTS:$opts" case "$prev" in --pipe)