mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-22 06:07:49 +00:00
e5a007415a
- don't list samples in the main help screen - improve the samples listing in list-samples - don't document the 'config' action, it's long dead - document the 'V' environment variable - improve on START, STOP and PREFIX environment variables - add PREFIX and V to autocomplete - advertise auto-complete at install time
35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
# 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]}
|
|
|
|
samples=$( "${COMP_WORDS[0]}" list-samples 2>/dev/null \
|
|
|tail -n +2 |sed -e '/^ /d; s/ .*//;' \
|
|
)
|
|
show_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1show-/g;')
|
|
build_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1build-/g;')
|
|
|
|
steps=$(${COMP_WORDS[0]} list-steps 2>/dev/null |awk '$1 == "-" { print $2; }')
|
|
start_steps=$(echo "${steps}" |sed -r -e 's/($| )/\1+/;')
|
|
stop_steps=$(echo "${steps}" |sed -r -e 's/(^| )/+\1/;')
|
|
|
|
actions='help menuconfig oldconfig saveconfig extractconfig
|
|
build build. build-all build-all.
|
|
list-samples list-steps show-tuple show-all show-config
|
|
clean distclean wiki-samples updatetools
|
|
tarball version'
|
|
|
|
vars="RESTART= STOP= PREFIX= V="
|
|
|
|
ct_ng_opts="${samples} ${show_samples} ${build_samples}
|
|
${steps} ${start_steps} ${stop_steps}
|
|
${actions} ${vars}"
|
|
|
|
COMPREPLY=($(compgen -W "${ct_ng_opts}" -- "${cur}"))
|
|
return 0
|
|
}
|
|
complete -F _ct-ng ct-ng
|