Add -V option to show version to void-mk{live,rootfs} and installer in the title.

This commit is contained in:
Juan RP 2013-08-11 12:16:29 +02:00
parent b877a74a49
commit 112a6a7775
3 changed files with 9 additions and 4 deletions

View File

@ -84,7 +84,7 @@ WIDGET_SIZE="10 70"
DIALOG() { DIALOG() {
rm -f $ANSWER rm -f $ANSWER
dialog --colors --keep-tite --no-shadow --no-mouse \ dialog --colors --keep-tite --no-shadow --no-mouse \
--backtitle "${BOLD}${WHITE}Void Linux installation -- http://www.voidlinux.eu/${RESET}" \ --backtitle "${BOLD}${WHITE}Void Linux installation -- http://www.voidlinux.eu/ (@@MKLIVE_VERSION@@)${RESET}" \
--cancel-label "Back" --aspect 20 "$@" 2>$ANSWER --cancel-label "Back" --aspect 20 "$@" 2>$ANSWER
return $? return $?
} }

View File

@ -29,6 +29,8 @@
set -E set -E
trap "echo; error_out $LINENO $?" INT TERM HUP ERR trap "echo; error_out $LINENO $?" INT TERM HUP ERR
readonly PROGNAME=$(basename $0)
info_msg() { info_msg() {
printf "\033[1m$@\n\033[m" printf "\033[1m$@\n\033[m"
} }
@ -110,6 +112,7 @@ Options:
current working directory will be used). current working directory will be used).
-o outfile Output file name for the ISO image. -o outfile Output file name for the ISO image.
-s splash Splash image file for isolinux. -s splash Splash image file for isolinux.
-V Show version.
_EOF _EOF
exit 1 exit 1
} }
@ -263,7 +266,7 @@ generate_iso_image() {
# #
# main() # main()
# #
while getopts "C:c:l:o:r:s:h" opt; do while getopts "C:c:l:o:r:s:hV" opt; do
case $opt in case $opt in
C) CONFIG_FILE="$OPTARG";; C) CONFIG_FILE="$OPTARG";;
c) COMPRESSTYPE="$OPTARG";; c) COMPRESSTYPE="$OPTARG";;
@ -272,6 +275,7 @@ while getopts "C:c:l:o:r:s:h" opt; do
r) ROOTDIR="$OPTARG";; r) ROOTDIR="$OPTARG";;
s) SPLASH_IMAGE="$OPTARG";; s) SPLASH_IMAGE="$OPTARG";;
h) usage;; h) usage;;
V) echo "$PROGNAME @@MKLIVE_VERSION@@"; exit 0;;
esac esac
done done
shift $(($OPTIND - 1)) shift $(($OPTIND - 1))

View File

@ -41,7 +41,7 @@ die() {
} }
usage() { usage() {
echo "Usage: $PROGNAME [-a raspberrypi]" echo "Usage: $PROGNAME [-a raspberrypi] [-V]"
} }
run_cmd() { run_cmd() {
@ -72,10 +72,11 @@ register_binfmt() {
# #
# main() # main()
# #
while getopts "a:h" opt; do while getopts "a:hV" opt; do
case $opt in case $opt in
a) TARGET_ARCH="$OPTARG";; a) TARGET_ARCH="$OPTARG";;
h) usage; exit 0;; h) usage; exit 0;;
V) echo "$PROGNAME @@MKLIVE_VERSION@@"; exit 0;;
esac esac
done done
shift $(($OPTIND - 1)) shift $(($OPTIND - 1))