# HG changeset patch # User "Yann E. MORIN" # Date 1220611013 0 # Node ID 8b976f2f38f914a6b73af763b82a04b65734a6a2 # Parent a705baca977c92f827d5d231b6ec0f50a29e5dce Add completion for crosstool-NG. To be sourced by a bash-compatible shell startup script; ideally, to be installed in /etc/bash_completion.d/ /trunk/ct-ng.comp | 30 30 0 0 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff -r a705baca977c -r 8b976f2f38f9 ct-ng.comp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ct-ng.comp Fri Sep 05 10:36:53 2008 +0000 @@ -0,0 +1,30 @@ +# 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) + show_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1show-/g;') + + steps=$(${COMP_WORDS[0]} list-steps |awk '$1 == "-" { print $2; }') + start_steps=$(echo "${steps}" |sed -r -e 's/(^| )/\1+/;') + stop_steps=$(echo "${steps}" |sed -r -e 's/(^| )/+\1/;') + + actions='config menuconfig oldconfig saveconfig extractconfig + list-samples build list-steps regtest regtest-local + regtest-global clean distclean wiki-samples update-tools + tarball' + + 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