Indentation fix, cleanup.
[AROS.git] / arch / all-pc / boot / grub2-aros / util / grub-kbdcomp.in
blob715c483af2719f32c9b767bd2e053bc499f137a5
1 #!/bin/sh
3 prefix="@prefix@"
4 exec_prefix="@exec_prefix@"
5 bindir="@bindir@"
6 datarootdir="@datarootdir@"
7 datadir="@datadir@"
8 if [ "x$pkgdatadir" = x ]; then
9 pkgdatadir="${datadir}/@PACKAGE@"
12 grub_mklayout="${bindir}/@grub_mklayout@"
14 ckbcomp_options=""
16 export TEXTDOMAIN=@PACKAGE@
17 export TEXTDOMAINDIR="@localedir@"
19 . "${pkgdatadir}/grub-mkconfig_lib"
21 self=`basename $0`
23 usage () {
24 gettext_printf "Usage: %s -o OUTPUT CKBMAP_ARGUMENTS...\n" "$self"
25 gettext "Make GRUB keyboard layout file."; echo
26 echo
27 print_option_help "-h, --help" "$(gettext "print this message and exit")"
28 print_option_help "-v, --version" "$(gettext "print the version information and exit")"
29 print_option_help "-o, --output=$(gettext FILE)" "$(gettext "save output in FILE [required]")"
30 echo
31 gettext_printf "%s generates a keyboard layout for GRUB using ckbcomp\n" "$self"
32 echo
33 gettext "Report bugs to <bug-grub@gnu.org>."; echo
36 argument () {
37 opt=$1
38 shift
40 if test $# -eq 0; then
41 gettext_printf "%s: option requires an argument -- \`%s'\n" "$0" "$opt" 1>&2
42 exit 1
44 echo $1
47 output=
49 while test $# -gt 0
51 option=$1
52 shift
53 case "$option" in
54 -h | --help)
55 usage
56 exit 0 ;;
57 -v | --version)
58 echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
59 exit 0 ;;
60 -o | --output)
61 output=`argument $option "$@"`; shift ;;
62 --output=*)
63 output=`echo "$option" | sed 's/--output=//'` ;;
65 ckbcomp_options="$ckbcomp_options $option";;
66 esac
67 done
69 if [ "x${output}" = x ] ; then
70 gettext "output file must be specified" >&2
71 echo >&2
72 usage
73 exit 1
76 ckbcomp $ckbcomp_options | "$grub_mklayout" -o "${output}"