2008-09-05 10:36:53 +00:00
|
|
|
# To be sourced
|
|
|
|
|
|
|
|
_ct-ng () {
|
|
|
|
local cur prev samples show_samples actions steps start_steps stop_steps ct_ng_opts vars
|
|
|
|
COMPREPLY=()
|
|
|
|
cur=$(_get_cword)
|
|
|
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
|
|
|
|
2008-10-12 10:38:02 +00:00
|
|
|
samples=$(${COMP_WORDS[0]} list-samples 2>/dev/null)
|
2008-09-05 10:36:53 +00:00
|
|
|
show_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1show-/g;')
|
|
|
|
|
2008-10-12 10:38:02 +00:00
|
|
|
steps=$(${COMP_WORDS[0]} list-steps 2>/dev/null |awk '$1 == "-" { print $2; }')
|
2008-10-14 20:06:37 +00:00
|
|
|
start_steps=$(echo "${steps}" |sed -r -e 's/($| )/\1+/;')
|
2008-09-05 10:36:53 +00:00
|
|
|
stop_steps=$(echo "${steps}" |sed -r -e 's/(^| )/+\1/;')
|
|
|
|
|
2008-10-13 20:36:37 +00:00
|
|
|
actions='menuconfig oldconfig saveconfig
|
2008-10-12 10:38:02 +00:00
|
|
|
list-samples build build. list-steps regtest regtest-local
|
2008-09-11 09:01:48 +00:00
|
|
|
regtest-global clean distclean wiki-samples updatetools
|
2008-10-14 19:29:25 +00:00
|
|
|
tarball version'
|
2008-09-05 10:36:53 +00:00
|
|
|
|
|
|
|
vars="RESTART= STOP="
|
|
|
|
|
|
|
|
ct_ng_opts="${samples} ${show_samples}
|
|
|
|
${steps} ${start_steps} ${stop_steps}
|
|
|
|
${actions} ${vars}"
|
|
|
|
|
|
|
|
COMPREPLY=($(compgen -W "${ct_ng_opts}" -- "${cur}"))
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
complete -F _ct-ng ct-ng
|