Skip to content
Snippets Groups Projects
Commit 20819feb authored by Jörg Sachse's avatar Jörg Sachse
Browse files

feat: parse get_cli_args() function, extract list of CLI options and discard the rest

parent 5bf09e1a
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment