man-pages/man1/whiptail.1.html
2021-03-31 01:06:50 +01:00

476 lines
11 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of WHIPTAIL</TITLE>
</HEAD><BODY>
<H1>WHIPTAIL</H1>
Section: User Commands (1)<BR>Updated: 31 January 2007<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
whiptail - display dialog boxes from shell scripts
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>whiptail</B>
[
<B>--title</B>
<I>title</I>
]
[
<B>--backtitle</B>
<I>backtitle</I>
]
[
<B>--clear</B>
]
[
<B>--default-item</B>
<I>string</I>
]
[
<B>--defaultno</B>
]
[
<B>--fb</B>
]
[
<B>--nocancel</B>
]
[
<B>--yes-button</B>
<I>text</I>
]
[
<B>--no-button</B>
<I>text</I>
]
[
<B>--ok-button</B>
<I>text</I>
]
[
<B>--cancel-button</B>
<I>text</I>
]
[
<B>--noitem</B>
[
]
<B>--output-fd</B>
<I>fd</I>
]
[
<B>--separate-output</B>
]
[
<B>--scrolltext</B>
]
[
<B>--topleft</B>
]
<B>box-options</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>whiptail</B>
is a program that will let you present a variety of questions or
display messages using dialog boxes from a shell script. Currently,
these types of dialog boxes are implemented:
<P>
<B>yes/no</B> box,<B> menu</B> box,<B> input</B> box,
<B>message</B> box,<B> text</B> box,<B> info</B> box,
<B>checklist</B> box,<B> radiolist</B> box<B>, gauge</B> box, and
<B>password</B> box.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>--clear</B>
<DD>
The screen will be cleared to the
<B>screen attribute</B> on exit.
This doesn't work in an xterm (and descendants) if alternate screen
switching is enabled, because in that case slang writes to (and clears)
an alternate screen.
<DT id="2"><B>--defaultno</B>
<DD>
The dialog box will open with the cursor over the
<B>No</B> button.
<DT id="3"><B>--default-item</B><I> string</I>
<DD>
Set the default item in a menu box.
Normally the first item in the box is the default.
<DT id="4"><B>--fb</B>, <B>--fullbuttons</B><DD>
Use full buttons. (By default,
<B>whiptail</B>
uses compact buttons).
<DT id="5"><B>--nocancel</B>
<DD>
The dialog box won't have a
<B>Cancel</B> button.
<DT id="6"><B>--yes-button</B><I> text</I>
<DD>
Set the text of the
<B>Yes</B> button.
<DT id="7"><B>--no-button</B><I> text</I>
<DD>
Set the text of the
<B>No</B> button.
<DT id="8"><B>--ok-button</B><I> text</I>
<DD>
Set the text of the
<B>Ok</B> button.
<DT id="9"><B>--cancel-button</B><I> text</I>
<DD>
Set the text of the
<B>Cancel</B> button.
<DT id="10"><B>--noitem</B>
<DD>
The menu, checklist and radiolist widgets will display tags only, not
the item strings. The menu widget still needs some items specified,
but checklist and radiolist expect only tag and status.
<DT id="11"><B>--notags</B>
<DD>
Don't display tags in the menu, checklist and radiolist widgets.
<DT id="12"><B>--separate-output</B>
<DD>
For checklist widgets, output result one line at a time, with no
quoting. This facilitates parsing by another program.
<DT id="13"><B>--output-fd</B><I> fd</I>
<DD>
Direct output to the given file descriptor. Most
<B>whiptail</B>
scripts
write to standard error, but error messages may also be
written there, depending on your script.
<DT id="14"><B>--title</B><I> title</I>
<DD>
Specifies a
<I>title</I>
string to be displayed at the top of the dialog box.
<DT id="15"><B>--backtitle</B><I> backtitle</I>
<DD>
Specifies a
<I>backtitle</I>
string to be displayed on the backdrop, at the top of the screen.
<DT id="16"><B>--scrolltext</B>
<DD>
Force the display of a vertical scrollbar.
<DT id="17"><B>--topleft</B>
<DD>
Put window in top-left corner.
<DT id="18"><B>-h</B>, <B>--help</B><DD>
Print a help message and exit.
<DT id="19"><B>-v</B>, <B>--version</B><DD>
Print version information and exit.
<DT id="20"><B>Box Options</B>
<DD>
<DT id="21"><B>--yesno</B><I> text height width</I>
<DD>
A<B> yes/no</B> dialog box of size
<I>height</I>
rows by
<I>width</I>
columns will be displayed. The string specified by
<I>text</I>
is displayed inside the dialog box. If this string is too long to be fit
in one line, it will be automatically divided into multiple lines at
appropriate places. The
<I>text</I>
string may also contain the sub-string
<I>&quot;\n&quot;</I>
or newline characters
<I>`\n'</I>
to control line breaking explicitly. This dialog box is useful for
asking questions that require the user to answer either yes or no.
The dialog box has a<B> Yes</B> button and a <B>No</B>
button, in which the user can switch between by pressing the
<I>TAB</I> key.
<DT id="22"><B>--msgbox</B><I> text height width</I>
<DD>
A<B> message</B> box is very similar to a<B> yes/no</B> box.
The only difference between a
<B>message</B>
box and a
<B>yes/no</B>
box is that a
<B>message</B>
box has only a single
<B>OK</B>
button. You can use this dialog box to display any message you like.
After reading the message, the user can press the
<I>ENTER</I>
key so that
<B>whiptail</B>
will exit and the calling shell script can continue its operation.
<DT id="23"><B>--infobox</B><I> text height width</I>
<DD>
An<B> info</B> box is basically a<B> message</B> box.
However, in this case,
<B>whiptail</B>
will exit immediately after displaying the message to the user. The
screen is not cleared when
<B>whiptail</B>
exits, so that the message will remain on the screen until the calling
shell script clears it later. This is useful when you want to inform
the user that some operations are carrying on that may require some
time to finish.
<DT id="24"><B>--inputbox</B><I> text height width [init]</I>
<DD>
An <B>input</B> box is useful when you want to ask questions that
require the user to input a string as the answer. If init is supplied
it is used to initialize the input string.
When inputing the
string, the
<I>BACKSPACE</I>
key can be used to correct typing errors. If the input string is longer than
the width of the dialog box, the input field will be scrolled. On exit,
the input string will be printed on
<I>stderr</I>.
<DT id="25"><B>--passwordbox</B><I> text height width [init]</I>
<DD>
A <B>password</B> box is similar to an input box, except the text the user
enters is not displayed. This is useful when prompting for passwords or other
sensitive information. Be aware that if anything is passed in &quot;init&quot;, it
will be visible in the system's process table to casual snoopers. Also, it
is very confusing to the user to provide them with a default password they
cannot see. For these reasons, using &quot;init&quot; is highly discouraged.
<DT id="26"><B>--textbox</B><I> file height width</I>
<DD>
A<B> text</B> box lets you display the contents of a text file in a
dialog box. It is like a simple text file viewer. The user can move
through the file by using the
<I>UP/DOWN</I>, <I>PGUP/PGDN</I>
and<I> HOME/END</I> keys available on most keyboards.
If the lines are too long to be displayed in the box, the
<I>LEFT/RIGHT</I>
keys can be used to scroll the text region horizontally. For more
convenience, forward and backward searching functions are also provided.
<DT id="27"><B>--menu </B><I>text height width menu-height </I>[ <I>tag item </I>] <I>...<DD>
As its name suggests, a
</I><B>menu</B>
box is a dialog box that can be used to present a list of choices in
the form of a menu for the user to choose. Each menu entry consists of a
<I>tag</I> string and an <I>item</I> string. The
<I>tag</I>
gives the entry a name to distinguish it from the other entries in the
menu. The
<I>item</I>
is a short description of the option that the entry represents. The
user can move between the menu entries by pressing the
<I>UP/DOWN</I>
keys, the first letter of the
<I>tag</I>
as a hot-key. There are
<I>menu-height</I>
entries displayed in the menu at one time, but the menu will be
scrolled if there are more entries than that. When
<B>whiptail</B>
exits, the
<I>tag</I>
of the chosen menu entry will be printed on
<I>stderr</I>.
<DT id="28"><B>--checklist </B><I>text height width list-height </I>[ <I>tag item status </I>] <I>...<DD>
</I>A <B>checklist</B> box is similar to a <B>menu</B> box in that there are
multiple entries presented in the form of a menu.
You can select and deselect items using the SPACE key.
The initial on/off state of each entry is specified by
<I>status</I>.
On exit, a list of the
<I>tag</I>
strings of those entries that are turned on will be printed on
<I>stderr</I>.
<P>
<DT id="29"><B>--radiolist </B><I>text height width list-height </I> [ <I>tag item status </I>] <I>...<DD>
</I>A <B>radiolist</B> box is similar to a <B>menu</B> box. The only difference is
that you can indicate which entry is currently selected, by setting its
<I>status</I> to <I>on</I>.
<P>
<DT id="30"><B>--gauge </B><I>text height width percent</I><DD>
A <B>gauge</B> box displays a meter along the bottom of the box.
The meter indicates a percentage. New percentages are read from
standard input, one integer per line. The meter is updated
to reflect each new percentage. If stdin is XXX, the first following line is
a percentage and subsequent lines up to another XXX are used for a new prompt.
The gauge exits when EOF is reached on stdin.
<P>
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>NOTES</H2>
whiptail interprets arguments starting with a dash &quot;-&quot; as being arguments.
To avoid this, and start some text in, for example, a menubox item, with a
dash, whiptail honours the getopt convention of accepting the special
argument &quot;--&quot; which means that all following arguments with dashes are to
be treated verbatim and not parsed as options.
<A NAME="lbAG">&nbsp;</A>
<H2>DIAGNOSTICS</H2>
Exit status is 0 if
<B>whiptail</B> is exited by pressing the <B>Yes</B> or <B>OK</B>
button, and 1 if the
<B>No</B> or <B>Cancel</B>
button is pressed. Otherwise, if errors occur inside
<B>whiptail</B>
or
<B>whiptail</B>
is exited by pressing the
<I>ESC</I>
key, the exit status is 255.
<A NAME="lbAH">&nbsp;</A>
<H2>AUTHOR</H2>
Based on the man page for <A HREF="/cgi-bin/man/man2html?1+dialog">dialog</A>(1) by:
<P>
Savio Lam (<A HREF="mailto:lam836@cs.cuhk.hk">lam836@cs.cuhk.hk</A>) - version 0.3
<P>
Stuart Herbert (<A HREF="mailto:S.Herbert@sheffield.ac.uk">S.Herbert@sheffield.ac.uk</A>) - patch for version 0.4
<P>
Modifications for whiptail by:
<P>
Enrique Zanardi (<A HREF="mailto:ezanard@debian.org">ezanard@debian.org</A>)
<P>
Alastair McKinstry (<A HREF="mailto:mckinstry@debian.org">mckinstry@debian.org</A>)
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="31"><A HREF="#lbAB">NAME</A><DD>
<DT id="32"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="33"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="34"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="35"><A HREF="#lbAF">NOTES</A><DD>
<DT id="36"><A HREF="#lbAG">DIAGNOSTICS</A><DD>
<DT id="37"><A HREF="#lbAH">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:29 GMT, March 31, 2021
</BODY>
</HTML>