diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2012-10-26 10:18:10 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2012-10-28 15:48:04 +0100 |
commit | f0bf8194ce3c5df564bea87129d634d2a9a2cc7a (patch) | |
tree | dd0e0fc05dddb9b4afd66c974995366288552922 /scripts/bash_completion | |
parent | 46a168b3a56224fe7889c4eb5a5c12db69cec92b (diff) | |
download | ptxdist-f0bf8194ce3c5df564bea87129d634d2a9a2cc7a.tar.gz ptxdist-f0bf8194ce3c5df564bea87129d634d2a9a2cc7a.tar.xz |
bash_completion: generate and cache newpackage options
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/bash_completion')
-rw-r--r-- | scripts/bash_completion | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/bash_completion b/scripts/bash_completion index 029d5a4ea..7be15df14 100644 --- a/scripts/bash_completion +++ b/scripts/bash_completion @@ -8,6 +8,7 @@ if have ptxdist; then declare -a _ptxdist_completion_opts +declare -a _ptxdist_completion_newpkg _ptxdist_completion() { local cur prev words cword split @@ -116,8 +117,11 @@ _ptxdist_completion() COMPREPLY=( $( compgen -W "${_ptxdist_completion_opts[*]} $( pushd $($_ptxdist_cmd print PTXDIST_PLATFORMDIR)/state >/dev/null; ls +(*.get|*.extract|*.prepare|*.compile|*.install|*.targetinstall); popd >/dev/null )" -- $cur ) ) ;; newpackage) + if [ ${#_ptxdist_completion_newpkg[@]} -eq 0 ]; then + _ptxdist_completion_newpkg=( $(${_ptxdist_cmd} newpackage | sed -n 's/^ \([^ ]*\) .*$/\1/p') ) + fi if [ ${#args[@]} -lt 1 ]; then - COMPREPLY=( $( compgen -W "${_ptxdist_completion_opts[*]} target host cross klibc src-autoconf-lib src-autoconf-prog src-autoconf-proglib src-cmake-prog src-qmake-prog src-make-prog src-linux-driver src-stellaris font simple kernel image-tgz image-genimage" -- $cur) ) + COMPREPLY=( $( compgen -W "${_ptxdist_completion_opts[*]} ${_ptxdist_completion_newpkg[*]}" -- $cur) ) fi ;; esac |