samples: add a short list of all samples

Add an action to list only the sample names.
Use that for auto-completion.
This commit is contained in:
Yann E. MORIN" 2010-07-30 23:30:02 +02:00
parent e1848908de
commit 749b819c92
2 changed files with 11 additions and 5 deletions

View File

@ -6,9 +6,7 @@ _ct-ng () {
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/ .*//;' \
)
samples=$( "${COMP_WORDS[0]}" list-samples-short 2>/dev/null )
show_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1show-/g;')
build_samples=$(echo "${samples}" |sed -r -e 's/(^| )/\1build-/g;')
@ -18,8 +16,9 @@ _ct-ng () {
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
wiki-samples list-samples list-samples-short list-steps
show-tuple show-all show-config
clean distclean updatetools
tarball version'
vars="RESTART= STOP= PREFIX= V="

View File

@ -53,6 +53,13 @@ PHONY += list-samples
list-samples: FORCE
$(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh $(CT_SAMPLES)
PHONY += list-samples-short
list-samples-short: FORCE
$(SILENT)for s in $(CT_SAMPLES); do \
printf "$${s}\n"; \
done
PHONY += wiki-samples
wiki-samples:
$(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w $(CT_SAMPLES)