1
0
mirror of synced 2026-01-26 11:42:00 +00:00

Fix code styling issues.

Tabs, trailing spaces, you name it.
This commit is contained in:
Stéphane Jourdois
2010-07-24 10:39:32 +02:00
committed by Axel Beckert
parent 64c9c8398b
commit dff767c692

View File

@@ -1,8 +1,8 @@
# -*- shell-script -*- #!/bin/bash
# #
# /etc/bash_completion.d/xen-tools # /etc/bash_completion.d/xen-tools
# #
# Completion functions for Bash. # Completion functions for Bash.
# #
# This file offers basic support for all the command line options, along with # This file offers basic support for all the command line options, along with
# some specialist support to complete filesystem types, distribution targets, # some specialist support to complete filesystem types, distribution targets,
@@ -55,8 +55,8 @@ _xen_create_image()
# Determine arguments dynamically. Avoids out-of-dateness. # Determine arguments dynamically. Avoids out-of-dateness.
opts=$(xen-create-image --help|grep -- --|awk '{print $1}' |grep -- -- | sort -u) opts=$(xen-create-image --help|grep -- --|awk '{print $1}' |grep -- -- | sort -u)
# #
# Complete the initial part of the IP in the configuration file. # Complete the initial part of the IP in the configuration file.
ip=`grep ^gateway /etc/xen-tools/xen-tools.conf 2>/dev/null | awk -F'= ' '{print $2}'` ip=`grep ^gateway /etc/xen-tools/xen-tools.conf 2>/dev/null | awk -F'= ' '{print $2}'`
@@ -78,71 +78,71 @@ _xen_create_image()
# #
# EVMS container completion # EVMS container completion
# #
evmscontainers=`evms_query containers 2>/dev/null` evmscontainers=`evms_query containers 2>/dev/null`
case "$prev" in case "$prev" in
--cache) --cache)
COMPREPLY=( $( compgen -W 'yes no' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W 'yes no' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--config) --config)
_filedir _filedir
return 0 return 0
;; ;;
--dir) --dir)
_filedir -d _filedir -d
return 0 return 0
;; ;;
--dist) --dist)
COMPREPLY=( $( compgen -W '${dists}' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W '${dists}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--evms) --evms)
COMPREPLY=( $( compgen -W '${evmscontainers}' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W '${evmscontainers}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--fs) --fs)
COMPREPLY=( $( compgen -W 'xfs ext3 reiserfs' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W 'xfs ext3 reiserfs' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--hooks) --hooks)
COMPREPLY=( $( compgen -W '0 1' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W '0 1' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--install) --install)
COMPREPLY=( $( compgen -W '0 1' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W '0 1' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--image) --image)
COMPREPLY=( $( compgen -W 'sparse full' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W 'sparse full' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--install-method) --install-method)
COMPREPLY=( $( compgen -W 'copy debootstrap rinse rpmstrap tar' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W 'copy debootstrap rinse rpmstrap tar' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--ip) --ip)
ip=`echo ${ip} | sed -e 's/[.][^.]*$/./'` ip=`echo ${ip} | sed -e 's/[.][^.]*$/./'`
COMPREPLY=( $(compgen -W "${ip}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${ip}" -- ${cur}) )
return 0 return 0
;; ;;
--lvm) --lvm)
COMPREPLY=( $( compgen -W '${vgs}' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W '${vgs}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--role) --role)
roles=$(ls -1 /etc/xen-tools/role.d/ | xargs echo ) roles=$(ls -1 /etc/xen-tools/role.d/ | xargs echo )
COMPREPLY=( $( compgen -W '${roles}' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W '${roles}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--partitions) --partitions)
partitions=$(for x in `/bin/ls -1 /etc/xen-tools/partitions.d/ 2>/dev/null | grep -v \/ 2>/dev/null`; do echo ${x} ; done ) partitions=$(for x in `/bin/ls -1 /etc/xen-tools/partitions.d/ 2>/dev/null | grep -v \/ 2>/dev/null`; do echo ${x} ; done )
COMPREPLY=( $( compgen -W '${partitions}' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W '${partitions}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
esac esac
if [[ ${cur} == -* ]] || [[ ${prev} == xen-create-image ]]; then if [[ ${cur} == -* ]] || [[ ${prev} == xen-create-image ]]; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0 return 0
@@ -167,14 +167,14 @@ _xen_create_nfs()
# Determine arguments dynamically. Avoids out-of-dateness. # Determine arguments dynamically. Avoids out-of-dateness.
opts=$(xen-create-nfs --help|grep -- --|awk '{print $1}' |grep -- -- | sort -u) opts=$(xen-create-nfs --help|grep -- --|awk '{print $1}' |grep -- -- | sort -u)
case "$prev" in case "$prev" in
--template) --template)
_filedir _filedir
return 0 return 0
;; ;;
esac esac
if [[ ${cur} == -* ]]; then if [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0 return 0
@@ -187,7 +187,7 @@ complete -F _xen_create_nfs xen-create-nfs
# #
# Completion for xen-delete-image # Completion for xen-delete-image
# #
_xen_delete_image() _xen_delete_image()
{ {
local cur prev opts vgs names local cur prev opts vgs names
COMPREPLY=() COMPREPLY=()
@@ -201,7 +201,7 @@ _xen_delete_image()
# #
# EVMS container completion # EVMS container completion
# #
evmscontainers=`evms_query containers 2>/dev/null` evmscontainers=`evms_query containers 2>/dev/null`
# #
@@ -213,22 +213,22 @@ _xen_delete_image()
case "${prev}" in case "${prev}" in
--dir) --dir)
_filedir -d _filedir -d
return 0 return 0
;;
--evms)
COMPREPLY=( $( compgen -W '${evmscontainers}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0
;; ;;
--evms)
COMPREPLY=( $( compgen -W '${evmscontainers}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0
;;
--hostname) --hostname)
names=`_find_xen_images` names=`_find_xen_images`
COMPREPLY=( $(compgen -W "${names}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${names}" -- ${cur}) )
return 0 return 0
;;
--lvm)
COMPREPLY=( $( compgen -W '${vgs}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0
;; ;;
--lvm)
COMPREPLY=( $( compgen -W '${vgs}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0
;;
esac esac
if [[ ${cur} == -* ]]; then if [[ ${cur} == -* ]]; then
@@ -249,7 +249,7 @@ complete -F _xen_delete_image xen-delete-image
# #
# Completion for xen-update-image # Completion for xen-update-image
# #
_xen_update_image() _xen_update_image()
{ {
local cur prev opts base names vgs local cur prev opts base names vgs
COMPREPLY=() COMPREPLY=()
@@ -271,17 +271,17 @@ _xen_update_image()
case "${prev}" in case "${prev}" in
--dir) --dir)
_filedir -d _filedir -d
return 0 return 0
;;
--evms)
COMPREPLY=( $( compgen -W '${evmscontainers}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0
;;
--lvm)
COMPREPLY=( $( compgen -W '${vgs}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0
;; ;;
--evms)
COMPREPLY=( $( compgen -W '${evmscontainers}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0
;;
--lvm)
COMPREPLY=( $( compgen -W '${vgs}' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0
;;
esac esac
if [[ ${cur} == -* ]]; then if [[ ${cur} == -* ]]; then
@@ -301,7 +301,7 @@ complete -F _xen_update_image xen-update-image
# #
# Completion for xen-list-images # Completion for xen-list-images
# #
_xen_list_images() _xen_list_images()
{ {
local cur prev opts vgs local cur prev opts vgs
COMPREPLY=() COMPREPLY=()
@@ -333,19 +333,19 @@ _xt-create-xen-config()
# Determine arguments dynamically. Avoids out-of-dateness. # Determine arguments dynamically. Avoids out-of-dateness.
opts=$(xt-create-xen-config --help|grep -- --|awk '{print $1}'|grep -- -- | sort -u) opts=$(xt-create-xen-config --help|grep -- --|awk '{print $1}'|grep -- -- | sort -u)
case "$prev" in case "$prev" in
--output) --output)
_filedir -d _filedir -d
return 0 return 0
;; ;;
--template) --template)
COMPREPLY=( $( compgen -f -- ${cur#*:} ) ) COMPREPLY=( $( compgen -f -- ${cur#*:} ) )
return 0 return 0
;; ;;
esac esac
if [[ ${cur} == -* ]]; then if [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0 return 0
@@ -368,25 +368,25 @@ _xt-customize-image()
# Determine arguments dynamically. Avoids out-of-dateness. # Determine arguments dynamically. Avoids out-of-dateness.
opts=$(xt-customize-image --help|grep -- --|awk '{print $1}'|grep -- -- | sort -u) opts=$(xt-customize-image --help|grep -- --|awk '{print $1}'|grep -- -- | sort -u)
# #
# Available distributions, from rpmstrap # Available distributions, from rpmstrap
# #
if [ -d /usr/lib/rpmstrap/scripts ]; then if [ -d /usr/lib/rpmstrap/scripts ]; then
dists=`/bin/ls -1 /usr/lib/rpmstrap/scripts` dists=`/bin/ls -1 /usr/lib/rpmstrap/scripts`
fi fi
case "$prev" in case "$prev" in
--dist) --dist)
COMPREPLY=( $( compgen -W '${dists} sid sarge etch lenny' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W '${dists} sid sarge etch lenny' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--location) --location)
_filedir -d _filedir -d
return 0 return 0
;; ;;
esac esac
if [[ ${cur} == -* ]]; then if [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0 return 0
@@ -410,7 +410,7 @@ _xt-install-image()
# Determine arguments dynamically. Avoids out-of-dateness. # Determine arguments dynamically. Avoids out-of-dateness.
opts=$(xt-install-image --help|grep -- --|awk '{print $1}'|grep -- -- | sort -u) opts=$(xt-install-image --help|grep -- --|awk '{print $1}'|grep -- -- | sort -u)
# #
# Available distributions, from rpmstrap # Available distributions, from rpmstrap
# #
@@ -420,28 +420,28 @@ _xt-install-image()
case "$prev" in case "$prev" in
--cache) --cache)
COMPREPLY=( $( compgen -W 'yes no' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W 'yes no' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--config) --config)
_filedir _filedir
return 0 return 0
;; ;;
--dist) --dist)
COMPREPLY=( $( compgen -W '${dists} sid sarge etch lenny' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W '${dists} sid sarge etch lenny' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--install-method) --install-method)
COMPREPLY=( $( compgen -W 'copy debootstrap rinse rpmstrap tar' -- "${COMP_WORDS[COMP_CWORD]}" ) ) COMPREPLY=( $( compgen -W 'copy debootstrap rinse rpmstrap tar' -- "${COMP_WORDS[COMP_CWORD]}" ) )
return 0 return 0
;; ;;
--location) --location)
_filedir -d _filedir -d
return 0 return 0
;; ;;
esac esac
if [[ ${cur} == -* ]]; then if [[ ${cur} == -* ]]; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0 return 0