bash-completion: Complete a workflow name after the --workflow option
Update bash completion for commit b80aa1d3a3
(preset: Easier command
line interface for Workflow Presets, 2024-09-30, v3.31.0-rc1~17^2).
Issue: #26270
This commit is contained in:
parent
81f49865f2
commit
3ae031992a
@ -201,6 +201,24 @@ _cmake()
|
||||
COMPREPLY=( $( compgen -W "$presets" -- "$quoted" ) )
|
||||
return
|
||||
;;
|
||||
--workflow)
|
||||
local quoted
|
||||
printf -v quoted %q "$cur"
|
||||
# Options allowed right after `--workflow`
|
||||
local workflow_options='--preset --list-presets --fresh'
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W "$workflow_options" -- "$quoted" ) )
|
||||
else
|
||||
local presets=$( cmake --list-presets=workflow 2>/dev/null |
|
||||
grep -o "^ \".*\"" | sed \
|
||||
-e "s/^ //g" \
|
||||
-e "s/\"//g" \
|
||||
-e 's/ /\\\\ /g' )
|
||||
COMPREPLY=( $( compgen -W "$presets $workflow_options" -- "$quoted" ) )
|
||||
fi
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
if ($is_old_completion || $is_init_completion); then
|
||||
|
Loading…
Reference in New Issue
Block a user