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;')
|
2013-01-21 23:32:38 +00:00
|
|
|
check_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1check-/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/;')
|
|
|
|
|
2015-09-01 23:11:30 +00:00
|
|
|
actions='help menuconfig nconfig oldconfig saveconfig extractconfig
|
2019-01-28 03:04:15 +00:00
|
|
|
defconfig savedefconfig olddefconfig upgradeconfig
|
2018-04-04 07:07:45 +00:00
|
|
|
build build-all
|
2013-01-21 23:32:38 +00:00
|
|
|
wiki-samples list-samples list-samples-short check-samples
|
|
|
|
list-steps
|
2010-07-30 21:30:02 +00:00
|
|
|
show-tuple show-all show-config
|
|
|
|
clean distclean updatetools
|
2014-10-03 17:13:46 +00:00
|
|
|
version'
|
2008-09-05 10:36:53 +00:00
|
|
|
|
2012-08-15 20:06:22 +00:00
|
|
|
vars="RESTART= STOP= PREFIX= V= DEFCONFIG="
|
2008-09-05 10:36:53 +00:00
|
|
|
|
2013-01-21 23:32:38 +00:00
|
|
|
ct_ng_opts="${samples} ${show_samples} ${build_samples} ${check_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
|
|
|
|
}
|
2018-04-04 07:07:45 +00:00
|
|
|
complete -F _ct_ng @progname@
|