diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-09-05 10:36:53 +0000 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2008-09-05 10:36:53 +0000 |
commit | 3dadbc69ac2663048736f6f78f250b2d79ed25a9 (patch) | |
tree | 050899acea7c46c12337b8c557892091884805ed /ct-ng.comp | |
parent | 1be967a15c9324babf854a6107ea2987ab6032ca (diff) | |
download | crosstool-ng-3dadbc69ac2663048736f6f78f250b2d79ed25a9.tar.gz crosstool-ng-3dadbc69ac2663048736f6f78f250b2d79ed25a9.tar.bz2 crosstool-ng-3dadbc69ac2663048736f6f78f250b2d79ed25a9.zip |
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(+)
Diffstat (limited to 'ct-ng.comp')
-rw-r--r-- | ct-ng.comp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/ct-ng.comp b/ct-ng.comp new file mode 100644 index 00000000..d45dd26f --- /dev/null +++ b/ct-ng.comp @@ -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 |