Make --version uniform and avoid hard-coded program name.

This commit is contained in:
Grégoire Sutre 2010-06-08 12:52:42 +02:00
parent e8a6f3b6a5
commit 0ea7c4f93c
12 changed files with 70 additions and 30 deletions

View file

@ -22,6 +22,10 @@ transform="@program_transform_name@"
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
PACKAGE_NAME=@PACKAGE_NAME@
PACKAGE_VERSION=@PACKAGE_VERSION@
self=`basename $0`
grub_editenv=${bindir}/`echo grub-editenv | sed ${transform}`
rootdir=
@ -30,7 +34,7 @@ rootdir=
# Print the usage.
usage () {
cat <<EOF
Usage: $0 [OPTION] entry
Usage: $self [OPTION] entry
Set the default boot entry for GRUB, for the next boot only.
-h, --help print this message and exit
@ -51,7 +55,7 @@ for option in "$@"; do
usage
exit 0 ;;
-v | --version)
echo "grub-reboot (GNU GRUB ${PACKAGE_VERSION})"
echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
exit 0 ;;
--root-directory=*)
rootdir=`echo "$option" | sed 's/--root-directory=//'` ;;