scripts: fix completion to show samples

(transplanted from bf1f86bdd79fd20126d20795f425f603a5544952)
This commit is contained in:
Yann E. MORIN" 2010-03-05 09:00:07 +01:00
parent abb31cc27d
commit 3865fbbf5e

View File

@ -6,7 +6,9 @@ _ct-ng () {
cur=$(_get_cword)
prev=${COMP_WORDS[COMP_CWORD-1]}
samples=$(${COMP_WORDS[0]} list-samples 2>/dev/null)
samples=$( ${COMP_WORDS[0]} list-samples 2>/dev/null \
|sed -r -e 's/^(.*) \(host: (.*)\)$/\2,\1/;' \
)
show_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1show-/g;')
build_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1build-/g;')