2 # Generate a terminfo command from a terminfo name.
4 # Copyright (C) 2002 Free Software Foundation, Inc.
6 # This file is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 Usage: grub-terminfo TERMNAME
25 Generate a terminfo command from a terminfo name.
27 -h, --help print this message and exit
28 -v, --version print the version information and exit
30 Report bugs to <bug-grub@gnu.org>.
35 echo "grub-terminfo: error: $1" 1>&2
40 for option
in "$@"; do
46 echo "grub-terminfo (GNU GRUB ${VERSION})"
49 error
"Unrecognized option \`$option'"
53 if test "x$termname" != x
; then
54 error
"More than one terminfo names?"
62 if test "x$termname" = x
; then
63 error
"termname not specified"
69 infocmp
-L -1 -g $termname |
sed -n -e "/$1/s/^[^=]*=\\(.*\\),\$/\\1/p"
72 cursor_address
="`get_seq cursor_address`"
73 if test "x$cursor_address" = x
; then
74 error
"cursor_address not found"
77 cursor_address
="--cursor-address=$cursor_address"
79 clear_screen
="`get_seq clear_screen`"
80 if test "x$clear_screen" != x
; then
81 clear_screen
="--clear-screen=$clear_screen"
84 enter_standout_mode
="`get_seq enter_standout_mode`"
85 if test "x$enter_standout_mode" != x
; then
86 enter_standout_mode
="--enter-standout-mode=$enter_standout_mode"
89 exit_standout_mode
="`get_seq exit_standout_mode`"
90 if test "x$exit_standout_mode" != x
; then
91 exit_standout_mode
="--exit-standout-mode=$exit_standout_mode"
94 echo "terminfo --name=$termname" $cursor_address $clear_screen \
95 $enter_standout_mode $exit_standout_mode