1
0
mirror of synced 2026-02-04 15:13:12 +00:00

Better bash completion for xen-create-image, by Nick Anderson.

This commit is contained in:
Steve Kemp
2008-01-30 19:05:33 +00:00
parent 3edc8b3ddb
commit d39f4fe8ec
2 changed files with 5 additions and 2 deletions

View File

@@ -14,6 +14,9 @@ Contributions
C.J. Adams-Collier <cjcollier [at] com.gmail.com
- Added new modular structure to the code.
Nick Anderson <nick [at] net.anders0n>
- Better bash completion for xen-create-image.
Ray Anthracite <ray [at] com.rayanthracite>
- Added support for EVMS installation types.

View File

@@ -133,7 +133,7 @@ _xen_create_image()
return 0
;;
--role)
roles=$(for x in `/bin/ls -1 /etc/xen-tools/role.d/ 2>/dev/null | grep -v \/ 2>/dev/null`; do echo ${x} ; done )
roles=$(ls -1 /etc/xen-tools/role.d/ | xargs echo )
COMPREPLY=( $( compgen -W '${roles}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0
;;
@@ -144,7 +144,7 @@ _xen_create_image()
;;
esac
if [[ ${cur} == -* ]]; then
if [[ ${cur} == -* ]] || [[ ${prev} == xen-create-image ]]; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi