2008-09-05 10:36:53 +00:00
|
|
|
# To be sourced
|
|
|
|
|
2012-05-29 16:52:13 +00:00
|
|
|
_ct_ng () {
|
2008-09-05 10:36:53 +00:00
|
|
|
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]}
|
|
|
|
|
2010-07-30 21:30:02 +00:00
|
|
|
samples=$( "${COMP_WORDS[0]}" list-samples-short 2>/dev/null )
|
2008-09-05 10:36:53 +00:00
|
|
|
show_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1show-/g;')
|
2008-10-31 18:31:01 +00:00
|
|
|
build_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1build-/g;')
|
2008-09-05 10:36:53 +00:00
|
|
|
|
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/;')
|
|
|
|
|
2010-02-11 20:28:10 +00:00
|
|
|
actions='help menuconfig oldconfig saveconfig extractconfig
|
2008-10-31 18:31:01 +00:00
|
|
|
build build. build-all build-all.
|
2010-07-30 21:30:02 +00:00
|
|
|
wiki-samples list-samples list-samples-short list-steps
|
|
|
|
show-tuple show-all show-config
|
|
|
|
clean distclean updatetools
|
2008-10-14 19:29:25 +00:00
|
|
|
tarball version'
|
2008-09-05 10:36:53 +00:00
|
|
|
|
2010-04-01 22:18:26 +00:00
|
|
|
vars="RESTART= STOP= PREFIX= V="
|
2008-09-05 10:36:53 +00:00
|
|
|
|
2008-10-31 18:31:01 +00:00
|
|
|
ct_ng_opts="${samples} ${show_samples} ${build_samples}
|
2008-09-05 10:36:53 +00:00
|
|
|
${steps} ${start_steps} ${stop_steps}
|
|
|
|
${actions} ${vars}"
|
|
|
|
|
|
|
|
COMPREPLY=($(compgen -W "${ct_ng_opts}" -- "${cur}"))
|
|
|
|
return 0
|
|
|
|
}
|
2012-05-29 16:52:13 +00:00
|
|
|
complete -F _ct_ng ct-ng
|