Merge "Usage message enhancement"
This commit is contained in:
commit
35830cc57c
@ -42,13 +42,15 @@ if [ "$SCRIPTNAME" == "ramdisk-image-create" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
function show_options () {
|
function show_options () {
|
||||||
|
echo "Usage: ${SCRIPTNAME} [OPTION]... [ELEMENT]..."
|
||||||
|
echo
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " -a i386|amd64|armhf -- set the architecture of the image"
|
echo " -a i386|amd64|armhf -- set the architecture of the image(default amd64)"
|
||||||
echo " -o filename -- set the name of the output file"
|
echo " -o imagename -- set the imagename of the output image file(default image)"
|
||||||
echo " -x -- turn on tracing"
|
echo " -x -- turn on tracing"
|
||||||
echo " -u -- uncompressed; do not compress the image - larger but faster"
|
echo " -u -- uncompressed; do not compress the image - larger but faster"
|
||||||
echo " -c -- clear environment before starting work"
|
echo " -c -- clear environment before starting work"
|
||||||
echo " --image-cache directory -- location for cached images (~/.cache/image-create)"
|
echo " --image-cache directory -- location for cached images(default ~/.cache/image-create)"
|
||||||
echo " --min-tmpfs size -- minimum size in GB needed in tmpfs to build the image"
|
echo " --min-tmpfs size -- minimum size in GB needed in tmpfs to build the image"
|
||||||
echo " --no-tmpfs -- do not use tmpfs to speed image build"
|
echo " --no-tmpfs -- do not use tmpfs to speed image build"
|
||||||
echo " --offline -- do not update cached resources"
|
echo " --offline -- do not update cached resources"
|
||||||
@ -56,15 +58,20 @@ function show_options () {
|
|||||||
echo " -n skip the default inclusion of the 'base' element"
|
echo " -n skip the default inclusion of the 'base' element"
|
||||||
echo " -p package[,package,package] -- list of packages to install in the image"
|
echo " -p package[,package,package] -- list of packages to install in the image"
|
||||||
fi
|
fi
|
||||||
|
echo " -h|--help -- display this help and exit"
|
||||||
echo
|
echo
|
||||||
echo "ELEMENTS_PATH will allow you to specify multiple locations for the elements."
|
echo "ELEMENTS_PATH will allow you to specify multiple locations for the elements."
|
||||||
exit 0
|
echo
|
||||||
|
echo "Examples:"
|
||||||
|
echo " ${SCRIPTNAME} -a amd64 -o ubuntu-amd64 vm ubuntu"
|
||||||
|
echo " export ELEMENTS_PATH=~/source/tripleo-image-elements/elements"
|
||||||
|
echo " ${SCRIPTNAME} -a amd64 -o fedora-amd64-heat-cfntools vm fedora heat-cfntools"
|
||||||
}
|
}
|
||||||
|
|
||||||
INSTALL_PACKAGES=""
|
INSTALL_PACKAGES=""
|
||||||
COMPRESS_IMAGE="true"
|
COMPRESS_IMAGE="true"
|
||||||
TEMP=`getopt -o a:ho:xucnp: -l no-tmpfs,offline,min-tmpfs: -n $SCRIPTNAME -- "$@"`
|
TEMP=`getopt -o a:ho:xucnp: -l no-tmpfs,offline,help,min-tmpfs: -n $SCRIPTNAME -- "$@"`
|
||||||
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
|
if [ $? -ne 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
|
||||||
|
|
||||||
# Note the quotes around `$TEMP': they are essential!
|
# Note the quotes around `$TEMP': they are essential!
|
||||||
eval set -- "$TEMP"
|
eval set -- "$TEMP"
|
||||||
@ -73,7 +80,7 @@ while true ; do
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
-a) export ARCH=$2; shift 2 ;;
|
-a) export ARCH=$2; shift 2 ;;
|
||||||
-o) export IMAGE_NAME=$2; shift 2 ;;
|
-o) export IMAGE_NAME=$2; shift 2 ;;
|
||||||
-h) show_options;;
|
-h|--help) show_options; exit 0;;
|
||||||
-x) shift; set -x;;
|
-x) shift; set -x;;
|
||||||
-u) shift; export COMPRESS_IMAGE="";;
|
-u) shift; export COMPRESS_IMAGE="";;
|
||||||
-c) shift ; export CLEAR_ENV=1;;
|
-c) shift ; export CLEAR_ENV=1;;
|
||||||
|
Loading…
Reference in New Issue
Block a user