Merge branch 'vendor/DHCPCD'
[dragonfly.git] / contrib / dialog / dialog.1
blob38662e985144d857e3982e8d516081e7ed972128
1 '\" t
2 .\" $Id: dialog.1,v 1.214 2020/03/27 21:14:23 tom Exp $
3 .\" Copyright 2005-2019,2020  Thomas E. Dickey
4 .\"
5 .\" This program is free software; you can redistribute it and/or modify
6 .\" it under the terms of the GNU Lesser General Public License, version 2.1
7 .\" as published by the Free Software Foundation.
8 .\"
9 .\" This program is distributed in the hope that it will be useful, but
10 .\" WITHOUT ANY WARRANTY; without even the implied warranty of
11 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 .\" Lesser General Public License for more details.
13 .\"
14 .\" You should have received a copy of the GNU Lesser General Public
15 .\" License along with this program; if not, write to
16 .\"     Free Software Foundation, Inc.
17 .\"     51 Franklin St., Fifth Floor
18 .\"     Boston, MA 02110, USA.
19 .\"
20 .\" definitions for renaming
21 .ds p dialog
22 .ds l dialog
23 .ds L Dialog
24 .ds D DIALOG
25 .\"
26 .de ES
27 .ne 8
28 .IP
30 .de Ex
31 .RS +7
32 .PP
33 .nf
34 .ft CW
36 .de Ee
37 .fi
38 .ft R
39 .RE
41 .\" Bulleted paragraph
42 .de bP
43 .ie n  .IP \(bu 4
44 .el    .IP \(bu 2
46 .ie \n(.g .ds `` \(lq
47 .el       .ds `` ``
48 .ie \n(.g .ds '' \(rq
49 .el       .ds '' ''
51 .TH \*D 1 "" "$Date: 2020/03/27 21:14:23 $"
52 .SH NAME
53 dialog \- display dialog boxes from shell scripts
54 .SH SYNOPSIS
55 \fB\*p --clear\fP
56 .br
57 .BI "\*p --create-rc " file
58 .br
59 \fB\*p --print-maxsize\fP
60 .br
61 \fB\*p\fP
62 \fIcommon-options\fP
63 \fIbox-options\fP
64 .SH DESCRIPTION
65 \fB\*L\fP
66 is a program that will let you present a variety of questions or
67 display messages using dialog boxes from a shell script.
68 These types of dialog boxes are implemented
69 (though not all are necessarily compiled into \fB\*p\fR):
70 .RS
71 .LP
72 .nh
73 .na
74 .BR buildlist ", "
75 .BR calendar ", "
76 .BR checklist ", "
77 .BR dselect ", "
78 .BR editbox ", "
79 .BR form ", "
80 .BR fselect ", "
81 .BR gauge ", "
82 .BR infobox ", "
83 .BR inputbox ", "
84 .BR inputmenu ", "
85 .BR menu ", "
86 .BR mixedform ", "
87 .BR mixedgauge ", "
88 .BR msgbox " (message), "
89 .BR passwordbox ", "
90 .BR passwordform ", "
91 .BR pause ", "
92 .BR prgbox ", "
93 .BR programbox ", "
94 .BR progressbox ", "
95 .BR radiolist ", "
96 .BR rangebox ", "
97 .BR tailbox ", "
98 .BR tailboxbg ", "
99 .BR textbox ", "
100 .BR timebox ", "
101 .BR treeview ", and "
102 .BR yesno " (yes/no)."
107 You can put more than one dialog box into a script:
109 Use the "\fB--and-widget\fP" token to force \fB\*p\fP to proceed to the next
110 dialog unless you have pressed ESC to cancel, or
112 Simply add the tokens for the next dialog box, making a chain.
113 \*L stops chaining when the return code from a dialog is nonzero,
114 e.g., Cancel or No (see DIAGNOSTICS).
116 Some widgets, e.g., checklist, will write text to \fB\*p\fP's output.
117 Normally that is the standard error, but there are options for
118 changing this:
119 \*(``\fB--output-fd\fP\*('',
120 \*(``\fB--stderr\fP\*('' and
121 \*(``\fB--stdout\fP\*(''.
122 No text is written if the Cancel button (or ESC) is pressed;
123 \fB\*p\fP exits immediately in that case.
125 .\" ************************************************************************
126 .SH OPTIONS
127 All options begin with \*(``\fB--\fP\*(''
128 (two ASCII hyphens,
129 for the benefit of those using systems with deranged locale support).
131 A \*(``\fB--\fP\*('' by itself is used as an escape,
132 i.e., the next token on the command-line is not treated as an option.
134 .B \*p --title -- --Not an option
137 The \*(``\fB--args\fP\*('' option tells \fB\*p\fP to list the command-line
138 parameters to the standard error.
139 This is useful when debugging complex scripts using
140 the \*(``\fB--\fP\*('' and \*(``\fB--file\fP\*('',
141 since the command-line may be rewritten as these are expanded.
143 The \*(``\fB--file\fP\*('' option tells \fB\*p\fP to read parameters from
144 the file named as its value.
146 .B \*p --file \fIparameterfile
149 Blanks not within double-quotes are discarded
150 (use backslashes to quote single characters).
151 The result is inserted into the command-line,
152 replacing \*(``\fB--file\fP\*('' and its option value.
153 Interpretation of the command-line resumes from that point.
154 If \fIparameterfile\fP begins with \*(``&\*('', \fB\*p\fP
155 interprets the following text as a file descriptor number
156 rather than a filename.
158 Most widgets accept \fIheight\fP and \fIwidth\fP parameters,
159 which can be used to automatically size the widget to accommodate
160 multi-line message \fIprompt\fP values:
162 If the parameter is negative,
163 \fB\*l\fP uses the screen's size.
165 If the parameter is zero,
166 \fB\*l\fP uses minimum size for the widget to display the \fIprompt\fP
167 and data.
169 Otherwise, \fB\*l\fP uses the given size for the widget.
171 .SS \fBCommon Options\fP
172 Most of the common options are reset before processing each widget.
174 .IP "\fB--ascii-lines
175 Rather than draw graphics lines around boxes,
176 draw ASCII \*(``+\*('' and \*(``-\*('' in the same place.
177 See also \*(``\fB--no-lines\fR\*(''.
179 .IP "\fB--aspect \fIratio"
180 This gives you some control over the box dimensions when using auto
181 sizing (specifying 0 for height and width).
182 It represents width / height.
183 The default is 9, which means 9 characters wide to every 1 line high.
185 .IP "\fB--backtitle \fIbacktitle"
186 Specifies a
187 \fIbacktitle\fP
188 string to be displayed on the backdrop, at the top of the screen.
190 .IP "\fB--begin \fIy x"
191 Specify the position of the upper left corner of a dialog box on the screen.
193 .IP "\fB--cancel-label \fIstring"
194 Override the label used for \*(``Cancel\*('' buttons.
196 .IP "\fB--clear"
197 Clears the widget screen, keeping only the screen_color background.
198 Use this when you combine widgets with \*(``\fB--and-widget\fR\*('' to erase the
199 contents of a previous widget on the screen, so it won't be seen
200 under the contents of a following widget.
201 Understand this as the complement of \*(``\fB--keep-window\fR\*(''.
202 To compare the effects, use these:
205 All three widgets visible, staircase effect, ordered 1,2,3:
207 \*p \e
208                                --begin 2 2 --yesno "" 0 0 \e
209     --and-widget               --begin 4 4 --yesno "" 0 0 \e
210     --and-widget               --begin 6 6 --yesno "" 0 0
214 Only the last widget is left visible:
216 \*p \e
217                  --clear       --begin 2 2 --yesno "" 0 0 \e
218     --and-widget --clear       --begin 4 4 --yesno "" 0 0 \e
219     --and-widget               --begin 6 6 --yesno "" 0 0
223 All three widgets visible, staircase effect, ordered 3,2,1:
225 \*p \e
226                  --keep-window --begin 2 2 --yesno "" 0 0 \e
227     --and-widget --keep-window --begin 4 4 --yesno "" 0 0 \e
228     --and-widget               --begin 6 6 --yesno "" 0 0
232 First and third widget visible, staircase effect, ordered 3,1:
234 \*p \e
235                  --keep-window --begin 2 2 --yesno "" 0 0 \e
236     --and-widget --clear       --begin 4 4 --yesno "" 0 0 \e
237     --and-widget               --begin 6 6 --yesno "" 0 0
240 Note, if you want to restore original console colors and send your
241 cursor home after the dialog program has exited, use the \fBclear\fR\ (1)
242 command.
244 .IP "\fB--colors"
245 Interpret embedded \*(``\eZ\*('' sequences in the dialog text
246 by the following character,
247 which tells \fB\*p\fP to set colors or video attributes:
250 0 through 7 are the ANSI color numbers used in curses:
251 black,
252 red,
253 green,
254 yellow,
255 blue,
256 magenta,
257 cyan and
258 white respectively.
260 Bold is set by 'b', reset by 'B'.
262 Reverse is set by 'r', reset by 'R'.
264 Underline is set by 'u', reset by 'U'.
266 The settings are cumulative, e.g., \*(``\eZb\eZ1\*('' makes the following text
267 bold (perhaps bright) red.
269 Restore normal settings with \*(``\eZn\*(''.
272 .IP "\fB--column-separator \fIstring"
273 Tell \fB\*p\fP to split data for radio/checkboxes and menus on the
274 occurrences of the given string, and to align the split data into columns.
276 .IP "\fB--cr-wrap"
277 Interpret embedded newlines in the dialog text as a newline on the screen.
278 Otherwise, \fB\*p\fR will only wrap lines
279 where needed to fit inside the text box.
281 Even though you can control line breaks with this,
282 \fB\*L\fR will still wrap any lines that are too long for the width of the box.
283 Without cr-wrap, the layout of your text may be formatted to look nice
284 in the source code of your script without affecting the way it will
285 look in the dialog.
287 The \fIcr-wrap\fP feature is implemented subject to these conditions:
290 the string contains \*(``\en\*('' and the \fB--no-nl-expand\fP option is
291 not used, or
293 the \fB--trim\fP option is used.
296 For more information, see \fBWhitespace Options\fP.
298 .IP "\fB--create-rc \fIfile"
299 When
300 \fB\*p\fP
301 supports run-time configuration,
302 this can be used to dump a sample configuration file to the file specified
304 .IR file "."
306 .IP "\fB--date-format \fIformat"
307 If the host provides \fBstrftime\fP,
308 this option allows you to specify the format of the date printed for
309 the \fB--calendar\fP widget.
310 The time of day (hour, minute, second) are the current local time.
312 .IP "\fB--defaultno"
313 Make the default value of the
314 \fByes/no\fP
315 box a
316 .BR No .
317 Likewise, treat the default button of widgets that provide
318 \*(``OK\*('' and \*(``Cancel\*(''
319 as a \fICancel\fP.
320 If \*(``\fB--nocancel\fP\*('' or \*(``\fB--visit-items\fP\*('' are given
321 those options overrides this,
322 making the default button always \*(``Yes\*(''
323 (internally the same as \*(``OK\*('').
325 .IP "\fB--default-button \fIstring"
326 Set the default (preselected) button in a widget.
327 By preselecting a button,
328 a script makes it possible for the user to simply press \fIEnter\fP
329 to proceed through a dialog with minimum interaction.
331 The option's value is the name of the button:
332 .IR ok ,
333 .IR yes ,
334 .IR cancel ,
335 .IR no ,
336 .IR help "\ or"
337 .IR extra .
339 Normally the first button in each widget is the default.
340 The first button shown is determined by the widget
341 together with the \*(``\fB--nook\fP\*('' and \*(``\fB--nocancel\fP\*('' options.
342 If this option is not given, there is no default button assigned.
344 .IP "\fB--default-item \fIstring"
345 Set the default item in a checklist, form or menu box.
346 Normally the first item in the box is the default.
348 .IP "\fB--exit-label \fIstring"
349 Override the label used for \*(``EXIT\*('' buttons.
351 .IP "\fB--extra-button"
352 Show an extra button, between \*(``OK\*('' and \*(``Cancel\*('' buttons.
354 .IP "\fB--extra-label \fIstring"
355 Override the label used for \*(``Extra\*('' buttons.
356 Note: for inputmenu widgets, this defaults to \*(``Rename\*(''.
358 .IP "\fB--help"
359 Prints the help message to the standard output and exits.
360 The help message is also printed if no options are given,
361 or if an unrecognized option is given.
363 .IP "\fB--help-button"
364 Show a help-button after \*(``OK\*('' and \*(``Cancel\*('' buttons
365 in boxes which have a list of tagged items
366 (i.e., checklist, radiolist, menu, and treeview boxes).
368 On exit, the return status indicates that the Help button was pressed.
369 \fB\*L\fP also writes a message to its output
370 after the token \*(``HELP\*('':
373 If "\fB--item-help\fR" is also given, the item-help text is written.
375 Otherwise, the item's tag (the first field) is written.
379 You can use the \fB--help-tags\fP option and/or set the DIALOG_ITEM_HELP
380 environment variable to modify these messages and exit-status.
382 This option can be applied to other widgets,
383 which have an \*(``OK\*('' button,
384 whether or not the \*(``Cancel\*('' button is used.
385 The return status and output are not treated specially for the other widgets;
386 the help-button is just an extra button.
388 .IP "\fB--help-label \fIstring"
389 Override the label used for \*(``Help\*('' buttons.
391 .IP "\fB--help-status"
392 If the help-button is selected,
393 writes the checklist, radiolist or form information
394 after the item-help \*(``HELP\*('' information.
395 This can be used to reconstruct the state of a checklist after processing
396 the help request.
398 .IP "\fB--help-tags"
399 Modify the messages written on exit for \fB--help-button\fP
400 by making them always just the item's tag.
401 This does not affect the exit status code.
403 .IP "\fB--hfile \fIfilename"
404 Display the given file using a textbox when the user presses F1.
406 .IP "\fB--hline \fIstring"
407 Display the given string centered at the bottom of the widget.
409 .IP "\fB--ignore"
410 Ignore options that \fB\*p\fP does not recognize.
411 Some well-known ones such as \*(``\fB--icon\fP\*('' are ignored anyway,
412 but this is a better choice for compatibility with other implementations.
414 .IP "\fB--input-fd \fIfd"
415 Read keyboard input from the given file descriptor.
416 Most \fB\*p\fR scripts read from the standard input,
417 but the gauge widget reads a pipe (which is always standard input).
418 Some configurations do not work properly when
419 \fB\*p\fP tries to reopen the terminal.
420 Use this option (with appropriate juggling of file-descriptors)
421 if your script must work in that type of environment.
423 .IP "\fB--insecure"
424 Makes the password widget friendlier but less secure,
425 by echoing asterisks for each character.
427 .IP "\fB--iso-week"
428 Set the starting point for the week-number
429 shown in the \*(``\fB--calendar\fP\*('' option
430 according to ISO-8601, which starts numbering
431 with the first week which includes a Thursday in January.
433 .IP "\fB--item-help"
434 Interpret the tags data for checklist, radiolist and menu boxes
435 adding a column which is displayed in the bottom line of the
436 screen, for the currently selected item.
438 .IP "\fB--keep-tite"
439 When built with \fBncurses\fP,
440 \fB\*p\fP normally checks to see if it is running in an \fBxterm\fP,
441 and in that case tries to suppress the initialization strings that
442 would make it switch to the alternate screen.
443 Switching between the normal and alternate screens
444 is visually distracting in a script which runs \fB\*p\fP
445 several times.
446 Use this option to allow \fB\*p\fP to use those initialization strings.
448 .IP "\fB--keep-window"
449 Normally when \fB\*p\fR performs several \fBtailboxbg\fR widgets
450 connected by \*(``\fB--and-widget\fR\*('',
451 it clears the old widget from the screen by painting over it.
452 Use this option to suppress that repainting.
454 At exit, \fB\*p\fR repaints all of the widgets which have been
455 marked with \*(``\fB--keep-window\fR\*('',
456 even if they are not \fBtailboxbg\fR widgets.
457 That causes them to be repainted in reverse order.
458 See the discussion of the \*(``\fB--clear\fR\*('' option for examples.
460 .IP "\fB--last-key"
461 At exit, report the last key which the user entered.
462 This is the curses key code rather than a symbol or literal character,
463 and is only reported for keys which are bound to an action.
464 It can be used by scripts to distinguish between two keys which are
465 bound to the same action.
467 .IP "\fB--max-input \fIsize"
468 Limit input strings to the given size.
469 If not specified, the limit is 2048.
471 .IP "\fB--no-cancel"
472 .IP "\fB--nocancel"
473 Suppress the \*(``Cancel\*('' button in checklist, inputbox and menu box modes.
474 A script can still test if the user pressed the ESC key to cancel to quit.
476 .IP "\fB--no-collapse"
477 Normally \fB\*p\fR converts tabs to spaces and reduces multiple
478 spaces to a single space for text which is displayed in a message boxes, etc.
479 Use this option to disable that feature.
480 Note that \fB\*p\fR will still wrap text,
481 subject to the \*(``\fB--cr-wrap\fR\*('' and \*(``\fB--trim\fR\*('' options.
483 The \fIno-collapse\fP feature is implemented subject to these conditions:
486 the string contains \*(``\en\*('' and the \fB--no-nl-expand\fP option is
487 not used, or
489 the \fB--trim\fP option is not used.
492 For more information, see \fBWhitespace Options\fP.
494 .IP "\fB--no-items"
495 Some widgets (checklist, inputmenu, radiolist, menu) display a list
496 with two columns (a \*(``tag\*('' and \*(``item\*('',
497 i.e., \*(``description\*('').
498 This option tells \fB\*p\fP to read shorter rows,
499 omitting the \*(``item\*('' part of the list.
500 This is occasionally useful, e.g., if the tags provide enough information.
502 See also \fB--no-tags\fP.
503 If both options are given, this one is ignored.
505 .IP "\fB--no-kill"
506 Tells
507 \fB\*p\fP
508 to put the
509 \fBtailboxbg\fP
510 box in the background,
511 printing its process id to \fB\*p\fP's output.
512 SIGHUP is disabled for the background process.
514 .IP "\fB--no-label \fIstring"
515 Override the label used for \*(``No\*('' buttons.
517 .IP "\fB--no-lines
518 Rather than draw lines around boxes, draw spaces in the same place.
519 See also \*(``\fB--ascii-lines\fR\*(''.
521 .IP "\fB--no-mouse
522 Do not enable the mouse.
524 .IP "\fB--no-nl-expand
525 Do not convert \*(``\en\*('' substrings of the message/prompt text into
526 literal newlines.
528 The \fIno-nl-expand\fP feature is used only if
529 the string contains \*(``\en\*('' so that there is something to convert.
531 For more information, see \fBWhitespace Options\fP.
533 .IP "\fB--no-ok"
534 .IP "\fB--nook"
535 Suppress the \*(``OK\*('' button in checklist, inputbox and menu box modes.
536 A script can still test if the user pressed
537 the \*(``Enter\*('' key to accept the data.
539 .IP "\fB--no-shadow"
540 Suppress shadows that would be drawn to the right and bottom of each dialog box.
542 .IP "\fB--no-tags"
543 Some widgets (checklist, inputmenu, radiolist, menu) display a list
544 with two columns (a \*(``tag\*('' and \*(``description\*('').
545 The tag is useful for scripting, but may not help the user.
546 The \fB--no-tags\fP option (from Xdialog) may be used to suppress the
547 column of tags from the display.
548 Unlike the \fB--no-items\fP option,
549 this does not affect the data which is read from the script.
551 Xdialog does not display the tag column for the analogous buildlist
552 and treeview widgets; \fB\*p\fP does the same.
554 Normally \fB\*p\fP allows you to quickly move to entries on the displayed list,
555 by matching a single character to the first character of the tag.
556 When the \fB--no-tags\fP option is given, \fB\*p\fP matches against
557 the first character of the description.
558 In either case, the matchable character is highlighted.
560 .IP "\fB--ok-label \fIstring"
561 Override the label used for \*(``OK\*('' buttons.
563 .IP "\fB--output-fd \fIfd"
564 Direct output to the given file descriptor.
565 Most \fB\*p\fR scripts write to the standard error,
566 but error messages may also be written there, depending on your script.
568 .IP "\fB--separator \fIstring"
569 .IP "\fB--output-separator \fIstring"
570 Specify a string that will separate the output on \fB\*p\fP's output from
571 checklists, rather than a newline (for \fB--separate-output\fP) or a space.
572 This applies to other widgets such as forms and editboxes which normally
573 use a newline.
575 .IP "\fB--print-maxsize"
576 Print the maximum size of dialog boxes, i.e., the screen size,
577 to \fB\*p\fP's output.
578 This may be used alone, without other options.
580 .IP "\fB--print-size"
581 Prints the size of each dialog box to \fB\*p\fP's output
582 when the box is initialized.
584 .IP "\fB--print-text-only \fIstring [ height [ width ] ]"
585 Prints the string as it would be wrapped in a message box
586 to \fB\*p\fP's output.
588 Because the optional \fIheight\fP and \fIwidth\fP default to zero,
589 if they are omitted, \fB\*p\fP autosizes according to the screen dimensions.
591 .IP "\fB--print-text-size \fIstring [ height [ width ] ]"
592 Prints the size of the string as it would be wrapped in a message box,
593 to \fB\*p\fP's output,
596 height width
599 Because the optional \fIheight\fP and \fIwidth\fP parameters default to zero,
600 if they are omitted, \fB\*p\fP autosizes according to the screen dimensions.
602 .IP "\fB--print-version"
603 Prints \fB\*p\fR's version to \fB\*p\fP's output.
604 This may be used alone, without other options.
605 It does not cause \fB\*l\fP to exit by itself.
607 .IP "\fB--quoted"
608 Normally \fB\*p\fP quotes the strings returned by checklist's
609 as well as the item-help text.
610 Use this option to quote all string results as needed
611 (i.e., if the string contains whitespace or a single or double-quote character).
613 .IP "\fB--reorder"
614 By default, the buildlist widget uses the same order for the output (right)
615 list as for the input (left).
616 Use this option to tell \fB\*p\fP to use the order
617 in which a user adds selections to the output list.
619 .IP "\fB--scrollbar"
620 For widgets holding a scrollable set of data,
621 draw a scrollbar on its right-margin.
622 This does not respond to the mouse.
624 .IP "\fB--separate-output"
625 For certain widgets (buildlist, checklist, treeview),
626 output result one line at a time, with no quoting.
627 This facilitates parsing by another program.
629 .IP "\fB--separate-widget \fIstring"
630 Specify a string that will separate the output on \fB\*p\fP's output from
631 each widget.
632 This is used to simplify parsing the result of a dialog with several widgets.
633 If this option is not given,
634 the default separator string is a tab character.
636 .IP "\fB--shadow"
637 Draw a shadow to the right and bottom of each dialog box.
639 .IP "\fB--single-quoted"
640 Use single-quoting as needed (and no quotes if unneeded) for the
641 output of checklist's as well as the item-help text.
643 If this option is not set, \fB\*p\fP may use double quotes around each item.
644 In either case,
645 \fB\*p\fP adds backslashes to make the output useful in shell scripts.
647 Single quotes would be needed if 
648 the string contains whitespace or a single or double-quote character.
650 .IP "\fB--size-err"
651 Check the resulting size of a dialog box before trying to use it,
652 printing the resulting size if it is larger than the screen.
653 (This option is obsolete, since all new-window calls are checked).
655 .IP "\fB--sleep \fIsecs"
656 Sleep (delay) for the given number of seconds after processing a dialog box.
658 .IP "\fB--stderr"
659 Direct output to the standard error.
660 This is the default, since curses normally writes screen updates to
661 the standard output.
663 .IP "\fB--stdout"
664 Direct output to the standard output.
665 This option is provided for compatibility with Xdialog,
666 however using it in portable scripts is not recommended,
667 since curses normally writes its screen updates to the standard output.
668 If you use this option, \fB\*p\fR attempts to reopen the terminal
669 so it can write to the display.
670 Depending on the platform and your environment, that may fail.
672 .IP "\fB--tab-correct"
673 Convert each tab character to one or more spaces
674 (for the \fBtextbox\fP widget; otherwise to a single space).
675 Otherwise, tabs are rendered according to the curses library's interpretation.
676 The \fB--no-collapse\fP option disables tab expansion.
678 .IP "\fB--tab-len \fIn"
679 Specify the number of spaces that a tab character occupies if the
680 \*(``\fB--tab-correct\fP\*('' option is given.
681 The default is 8.
682 This option is only effective for the \fBtextbox\fP widget.
684 .IP "\fB--time-format \fIformat"
685 If the host provides \fBstrftime\fP,
686 this option allows you to specify the format of the time printed for
687 the \fB--timebox\fP widget.
688 The day, month, year values in this case are for the current local time.
690 .IP "\fB--timeout \fIsecs"
691 Timeout (exit with error code)
692 if no user response within the given number of seconds.
693 A timeout of zero seconds is ignored.
695 This option is ignored by the \*(``\fB--pause\fP\*('' widget.
696 It is also overridden
697 if the background \*(``\fB--tailboxbg\fP\*('' option is used
698 to set up multiple concurrent widgets.
700 .IP "\fB--title \fItitle"
701 Specifies a
702 \fItitle\fP
703 string to be displayed at the top of the dialog box.
705 .IP "\fB--trace \fIfilename"
706 logs the command-line parameters,
707 keystrokes and other information to the given file.
708 If \fB\*l\fP reads a configure file, it is logged as well.
709 Piped input to the \fIgauge\fP widget is logged.
710 Use control/T to log a picture of the current dialog window.
712 The \fB\*p\fR program handles some command-line parameters specially,
713 and removes them from the parameter list as they are processed.
714 For example, if the first option is \fB--trace\fP,
715 then that is processed (and removed) before \fB\*p\fR initializes the display.
717 .IP "\fB--week-start \fIday"
718 sets the starting day for the week,
719 used in the \*(``\fB--calendar\fP\*('' option.
720 The \fIday\fP parameter can be
723 a number (0 to 6, Sunday through Saturday using POSIX) or
725 the special value \*(``locale\*('' (this works with systems using glibc,
726 providing an extension to the \fBlocale\fP command,
727 the \fBfirst_weekday\fP value).
729 a string matching one of the abbreviations for the day of the week
730 shown in the \fBcalendar\fP widget, e.g., \*(``Mo\*('' for \*(``Monday\*(''.
733 .IP "\fB--trim"
734 eliminate leading blanks,
735 trim literal newlines and repeated blanks from message text.
737 The \fItrim\fP feature is implemented subject to these conditions:
740 the string does not contain \*(``\en\*('' or
742 the \fB--no-nl-expand\fP option is used.
745 For more information, see \fBWhitespace Options\fP.
748 See also the \*(``\fB--cr-wrap\fR\*(''
749 and \*(``\fB--no-collapse\fR\*('' options.
751 .IP "\fB--version"
752 Prints \fB\*p\fR's version to the standard output, and exits.
753 See also \*(``\fB--print-version\fP\*(''.
755 .IP "\fB--visit-items"
756 Modify the tab-traversal of checklist, radiolist, menubox and inputmenu
757 to include the list of items as one of the states.
758 This is useful as a visual aid,
759 i.e., the cursor position helps some users.
761 When this option is given, the cursor is initially placed on the list.
762 Abbreviations (the first letter of the tag) apply to the list items.
763 If you tab to the button row, abbreviations apply to the buttons.
765 .IP "\fB--yes-label \fIstring"
766 Override the label used for \*(``Yes\*('' buttons.
768 .\" ************************************************************************
769 .SS Box Options
770 All dialog boxes have at least three parameters:
771 .TP 7
772 \fItext\fP
773 the caption or contents of the box.
774 .TP 7
775 \fIheight\fP
776 the height of the dialog box.
777 .TP 7
778 \fIwidth\fP
779 the width of the dialog box.
781 Other parameters depend on the box type.
784 .IP "\fB--buildlist \fItext height width list-height \fR[ \fItag item status \fR] \fI..."
785 A \fBbuildlist\fP dialog displays two lists, side-by-side.
786 The list on the left shows unselected items.
787 The list on the right shows selected items.
788 As items are selected or unselected, they move between the lists.
790 Use a carriage return or the \*(``OK\*('' button to accept the current value
791 in the selected-window and exit.
792 The results are written using the order displayed in the selected-window.
794 The initial on/off state of each entry is specified by
795 .IR status "."
797 The dialog behaves like a \fBmenu\fP, using the \fB--visit-items\fP
798 to control whether the cursor is allowed to visit the lists directly.
801 If \fB--visit-items\fP is not given,
802 tab-traversal uses two states (OK/Cancel).
804 If \fB--visit-items\fP is given,
805 tab-traversal uses four states (Left/Right/OK/Cancel).
808 Whether or not \fB--visit-items\fP is given,
809 it is possible to move the highlight between the two lists using
810 the default \*(``^\*('' (left-column) and \*(``$\*('' (right-column) keys.
812 On exit, a list of the \fItag\fP
813 strings of those entries that are turned on
814 will be printed on \fB\*p\fP's output.
816 If the "\fB--separate-output\fP" option is not given,
817 the strings will be quoted as needed
818 to make it simple for scripts to separate them.
819 By default, this uses double-quotes, as needed.
820 See the \*(``\fB--single-quoted\fP\*('' option,
821 which modifies the quoting behavior.
823 .IP "\fB--calendar \fItext height width day month year"
824 A \fBcalendar\fP box displays
825 month, day and year in separately adjustable windows.
826 If the values for day, month or year are missing or negative,
827 the current date's corresponding values are used.
828 You can increment or decrement any of those using the
829 left-, up-, right-, and down-arrows.
830 Use vi-style h, j, k and l for moving around the array of days in a month.
831 Use tab or backtab to move between windows.
832 If the year is given as zero, the current date is used as an initial value.
834 On exit, the date is printed in the form day/month/year.
835 The format can be overridden using the \fB--date-format\fP option.
837 .IP "\fB--checklist \fItext height width list-height \fR[ \fItag item status \fR] \fI..."
838 A \fBchecklist\fP box is similar to a \fBmenu\fP box;
839 there are multiple entries presented in the form of a menu.
840 Another difference is
841 that you can indicate which entry is currently selected, by setting its
842 .IR status " to " on "."
843 Instead of choosing
844 one entry among the entries, each entry can be turned on or off by the user.
845 The initial on/off state of each entry is specified by
846 .IR status "."
848 On exit, a list of the \fItag\fP
849 strings of those entries that are turned on
850 will be printed on \fB\*p\fP's output.
852 If the \*(``\fB--separate-output\fP\*('' option is not given,
853 the strings will be quoted as needed
854 to make it simple for scripts to separate them.
855 By default, this uses double-quotes (as needed).
856 See the \*(``\fB--single-quoted\fP\*('' option,
857 which modifies the quoting behavior.
859 .IP "\fB--dselect \fIfilepath height width\fR"
860 The directory-selection dialog displays a text-entry window
861 in which you can type a directory,
862 and above that a windows with directory names.
864 Here
865 \fBfilepath\fP
866 can be a filepath in which case the directory window
867 will display the contents of the path and the text-entry window will contain
868 the preselected directory.
870 Use tab or arrow keys to move between the windows.
871 Within the directory window, use the up/down arrow keys
872 to scroll the current selection.
873 Use the space-bar to copy the current selection into the text-entry
874 window.
876 Typing any printable characters switches focus to the text-entry window,
877 entering that character as well as scrolling the directory
878 window to the closest match.
880 Use a carriage return or the \*(``OK\*('' button to accept the current value
881 in the text-entry window and exit.
883 On exit, the contents of the text-entry window are written
884 to \fB\*p\fP's output.
886 .IP "\fB--editbox \fIfilepath height width\fR"
887 The edit-box dialog displays a copy of the file.
888 You may edit it using
889 the \fIbackspace\fP, \fIdelete\fP and cursor keys
890 to correct typing errors.
891 It also recognizes pageup/pagedown.
892 Unlike the \fB--inputbox\fP,
893 you must tab to the \*(``OK\*('' or \*(``Cancel\*('' buttons
894 to close the dialog.
895 Pressing the \*(``Enter\*('' key within the box will split
896 the corresponding line.
898 On exit, the contents of the edit window are written to \fB\*p\fP's output.
901 .IP "\fB--form \fItext height width formheight \fR[ \fIlabel y x item y x flen ilen \fR] \fI..."
903 The \fBform\fP dialog displays a form consisting of labels and fields,
904 which are positioned on a scrollable window by coordinates given in the script.
905 The field length \fIflen\fR and input-length \fIilen\fR tell how long
906 the field can be.
907 The former defines the length shown for a selected field,
908 while the latter defines the permissible length of the data entered in the
909 field.
912 If \fIflen\fR is zero, the corresponding field cannot be altered.
913 and the contents of the field determine the displayed-length.
915 If \fIflen\fR is negative, the corresponding field cannot be altered,
916 and the negated value of \fIflen\fR is used as the displayed-length.
918 If \fIilen\fR is zero, it is set to \fIflen\fR.
921 Use up/down arrows (or control/N, control/P) to move between fields.
922 Use tab to move between windows.
924 On exit, the contents of the form-fields are written to \fB\*p\fP's output,
925 each field separated by a newline.
926 The text used to fill non-editable fields
927 (\fIflen\fR is zero or negative)
928 is not written out.
931 .IP "\fB--fselect \fIfilepath height width\fR"
932 The \fBfselect\fP (file-selection) dialog displays a text-entry window
933 in which you can type a filename (or directory),
934 and above that two windows with directory names and filenames.
936 Here
937 \fBfilepath\fP
938 can be a filepath in which case the file and directory windows
939 will display the contents of the path and the text-entry window will contain
940 the preselected filename.
942 Use tab or arrow keys to move between the windows.
943 Within the directory or filename windows, use the up/down arrow keys
944 to scroll the current selection.
945 Use the space-bar to copy the current selection into the text-entry
946 window.
948 Typing any printable characters switches focus to the text-entry window,
949 entering that character as well as scrolling the directory and filename
950 windows to the closest match.
952 Typing the space character forces \fB\*p\fP to complete the current
953 name (up to the point where there may be a match against more than one
954 entry).
956 Use a carriage return or the \*(``OK\*('' button to accept the current value
957 in the text-entry window and exit.
959 On exit, the contents of the text-entry window are written
960 to \fB\*p\fP's output.
963 .IP "\fB--gauge \fItext height width [percent]\fR"
965 \fBgauge\fP
966 box displays a meter along the bottom of the box.
967 The meter indicates the percentage.
968 New percentages are read from
969 standard input, one integer per line.
970 The meter is updated
971 to reflect each new percentage.
972 If the standard input reads the string \*(``XXX\*('',
973 then the first line following is taken as an integer percentage,
974 then subsequent lines up to another \*(``XXX\*('' are used for a new prompt.
975 The gauge exits when EOF is reached on the standard input.
977 The \fIpercent\fR value denotes the initial percentage shown in the meter.
978 If not specified, it is zero.
980 On exit, no text is written to \fB\*p\fP's output.
981 The widget accepts no input, so the exit status is always OK.
984 .IP "\fB--infobox \fItext height width"
985 An \fBinfo\fP box is basically a \fBmessage\fP box.
986 However, in this case, \fB\*p\fP
987 will exit immediately after displaying the message to the user.
988 The screen is not cleared when \fB\*p\fP
989 exits, so that the message will remain on the screen until the calling
990 shell script clears it later.
991 This is useful when you want to inform
992 the user that some operations are carrying on that may require some
993 time to finish.
995 On exit, no text is written to \fB\*p\fP's output.
996 An OK exit status is returned.
999 .IP "\fB--inputbox \fItext height width [init]"
1001 \fBinput\fP
1002 box is useful when you want to ask questions that
1003 require the user to input a string as the answer.
1004 If init is supplied
1005 it is used to initialize the input string.
1006 When entering the string,
1007 the \fIbackspace\fP, \fIdelete\fP and cursor keys
1008 can be used to correct typing errors.
1009 If the input string is longer than
1010 can fit in the dialog box, the input field will be scrolled.
1012 On exit, the input string will be printed on \fB\*p\fP's output.
1015 .IP "\fB--inputmenu \fItext height width menu-height \fR[ \fItag item \fR] \fI..."
1016 An \fBinputmenu\fP box is very similar to an ordinary \fBmenu\fP box.
1017 There are only a few differences between them:
1019 .TP 4
1021 The entries are not automatically centered but left adjusted.
1024 An extra button (called \fIRename\/\fP) is implied to rename
1025 the current item when it is pressed.
1028 It is possible to rename the current entry by pressing the
1029 \fIRename\fP
1030 button.
1031 Then \fB\*p\fP will write the following on \fB\*p\fP's output.
1033 RENAMED <tag> <item>
1037 .IP "\fB--menu \fItext height width menu-height \fR[ \fItag item \fR] \fI..."
1038 As its name suggests, a
1039 \fBmenu\fP
1040 box is a dialog box that can be used to present a list of choices in
1041 the form of a menu for the user to choose.
1042 Choices are displayed in the order given.
1043 Each menu entry consists of a \fItag\fP string and an \fIitem\fP string.
1044 The \fItag\fP
1045 gives the entry a name to distinguish it from the other entries in the
1046 menu.
1047 The \fIitem\fP is a short description of the option that the entry represents.
1048 The user can move between the menu entries by pressing the
1049 cursor keys, the first letter of the \fItag\fP
1050 as a hot-key, or the number keys \fI1\fP through \fI9\fP.
1051 There are \fImenu-height\fP
1052 entries displayed in the menu at one time, but the menu will be
1053 scrolled if there are more entries than that.
1055 On exit the \fItag\fP
1056 of the chosen menu entry will be printed on \fB\*p\fP's output.
1057 If the \*(``\fB--help-button\fR\*('' option is given, the corresponding help
1058 text will be printed if the user selects the help button.
1061 .IP "\fB--mixedform \fItext height width formheight \fR[ \fIlabel y x item y x flen ilen itype \fR] \fI..."
1063 The \fBmixedform\fP dialog displays a form consisting of labels and fields,
1064 much like the \fB--form\fP dialog.
1065 It differs by adding a field-type parameter to each field's description.
1066 Each bit in the type denotes an attribute of the field:
1068 .TP 5
1070 hidden, e.g., a password field.
1071 .TP 5
1073 readonly, e.g., a label.
1076 .IP "\fB--mixedgauge \fItext height width percent \fR[ \fItag1 item1 \fR] \fI..."
1077 A \fBmixedgauge\fP box displays a meter along the bottom of the box.
1078 The meter indicates the percentage.
1080 It also displays a list of the \fItag\/\fP- and \fIitem\/\fP-values at the
1081 top of the box.
1082 See \*l(3) for the tag values.
1084 The \fItext\fP is shown as a caption between the list and meter.
1085 The \fIpercent\fR value denotes the initial percentage shown in the meter.
1087 No provision is made for reading data from the standard input as \fB--gauge\fP
1088 does.
1090 On exit, no text is written to \fB\*p\fP's output.
1091 The widget accepts no input, so the exit status is always OK.
1093 .IP "\fB--msgbox \fItext height width"
1094 A \fBmessage\fP box is very similar to a \fByes/no\fP box.
1095 The only difference between a \fBmessage\fP box and a \fByes/no\fP
1096 box is that a \fBmessage\fP box has only a single \fBOK\fP button.
1097 You can use this dialog box to display any message you like.
1098 After reading the message, the user can press the \fIENTER\fP key so that
1099 \fB\*p\fP will exit and the calling shell script can continue its operation.
1101 If the message is too large for the space,
1102 \fB\*p\fP may allow you to scroll it,
1103 provided that the underlying curses implementation is capable enough.
1104 In this case, a percentage is shown in the base of the widget.
1106 On exit, no text is written to \fB\*p\fP's output.
1107 Only an \*(``OK\*('' button is provided for input,
1108 but an ESC exit status may be returned.
1110 .IP "\fB--pause \fItext height width seconds\fR"
1112 \fBpause\fP
1113 box displays a meter along the bottom of the box.
1114 The meter indicates how many seconds remain until the end of the pause.
1115 The pause exits when timeout is reached
1116 or the user presses the OK button
1117 (status OK)
1118 or the user presses the CANCEL button
1119 or Esc key.
1120 .IP "\fB--passwordbox \fItext height width [init]"
1121 A \fBpassword\fP box is similar to an input box,
1122 except that the text the user enters is not displayed.
1123 This is useful when prompting for passwords or other
1124 sensitive information.
1125 Be aware that if anything is passed in \*(``init\*('', it
1126 will be visible in the system's process table to casual snoopers.
1127 Also, it
1128 is very confusing to the user to provide them with a default password they
1129 cannot see.
1130 For these reasons, using \*(``init\*('' is highly discouraged.
1131 See \*(``\fB--insecure\fP\*('' if you do not care about your password.
1133 On exit, the input string will be printed on \fB\*p\fP's output.
1137 .IP "\fB--passwordform \fItext height width formheight \fR[ \fIlabel y x item y x flen ilen \fR] \fI..."
1139 This is identical to \fB--form\fP except that all text fields are
1140 treated as \fBpassword\fP widgets rather than \fBinputbox\fP widgets.
1143 .IP "\fB--prgbox \fItext command height width"
1144 .IP "\fB--prgbox \fIcommand height width"
1145 A \fBprgbox\fP is very similar to a \fBprogrambox\fP.
1147 This dialog box is used to display the output of a command that is
1148 specified as an argument to \fBprgbox\fP.
1150 After the command completes, the user can press the \fIENTER\fP key so that
1151 \fB\*l\fP will exit and the calling shell script can continue its operation.
1153 If three parameters are given, it displays the text under the title,
1154 delineated from the scrolling file's contents.
1155 If only two parameters are given, this text is omitted.
1158 .IP "\fB--programbox \fItext height width"
1159 .IP "\fB--programbox \fIheight width"
1160 A \fBprogrambox\fP is very similar to a \fBprogressbox\fP.
1161 The only difference between a \fBprogram\fP box and a \fBprogress\fP
1162 box is that a \fBprogram\fP box displays an \fBOK\fP button
1163 (but only after the command completes).
1165 This dialog box is used to display the piped output of a command.
1166 After the command completes, the user can press the \fIENTER\fP key so that
1167 \fB\*l\fP will exit and the calling shell script can continue its operation.
1169 If three parameters are given, it displays the text under the title,
1170 delineated from the scrolling file's contents.
1171 If only two parameters are given, this text is omitted.
1174 .IP "\fB--progressbox \fItext height width"
1175 .IP "\fB--progressbox \fIheight width"
1176 A \fBprogressbox\fP is similar to an \fBtailbox\fP,
1177 except that
1179 .TP 3
1180 a) rather than displaying the contents of a file,
1181 it displays the piped output of a command and
1182 .TP 3
1183 b) it will exit when it reaches the end of the file
1184 (there is no \*(``OK\*('' button).
1187 If three parameters are given, it displays the text under the title,
1188 delineated from the scrolling file's contents.
1189 If only two parameters are given, this text is omitted.
1192 .IP "\fB--radiolist \fItext height width list-height \fR [ \fItag item status \fR] \fI..."
1193 A \fBradiolist\fP box is similar to a \fBmenu\fP box.
1194 The only difference is
1195 that you can indicate which entry is currently selected, by setting its
1196 .IR status " to " on "."
1198 On exit, the tag of the selected item is written to \fB\*p\fP's output.
1201 .IP "\fB--tailbox \fIfile height width"
1202 Display text from a file in a dialog box,
1203 as in a \*(``tail -f\*('' command.
1204 Scroll left/right using vi-style 'h' and 'l', or arrow-keys.
1205 A '0' resets the scrolling.
1207 On exit, no text is written to \fB\*p\fP's output.
1208 Only an \*(``OK\*('' button is provided for input,
1209 but an ESC exit status may be returned.
1213 .IP "\fB--rangebox \fItext height width min-value max-value default-value"
1215 Allow the user to select from a range of values, e.g., using a slider.
1216 The dialog shows the current value as a bar (like the gauge dialog).
1217 Tabs or arrow keys move the cursor between the buttons and the value.
1218 When the cursor is on the value,
1219 you can edit it by:
1221 .TP 5
1222 left/right cursor movement to select a digit to modify
1223 .TP 5
1225 characters to increment/decrement the digit by one
1226 .TP 5
1227 0 through 9
1228 to set the digit to the given value
1231 Some keys are also recognized in all cursor positions:
1233 .TP 5
1234 home/end
1235 set the value to its maximum or minimum
1236 .TP 5
1237 pageup/pagedown
1238 increment the value so that the slider moves by one column
1242 .IP "\fB--tailboxbg \fIfile height width"
1243 Display text from a file in a dialog box as a background task,
1244 as in a \*(``tail -f &\*('' command.
1245 Scroll left/right using vi-style 'h' and 'l', or arrow-keys.
1246 A '0' resets the scrolling.
1248 \*L treats the background task specially if there are other
1249 widgets (\fB--and-widget\fP) on the screen concurrently.
1250 Until those widgets are closed (e.g., an \*(``OK\*(''),
1251 \fB\*p\fP will perform all of the tailboxbg widgets in the same process,
1252 polling for updates.
1253 You may use a tab to traverse between the widgets on the screen,
1254 and close them individually, e.g., by pressing \fIENTER\fP.
1255 Once the non-tailboxbg widgets are closed,
1256 \fB\*p\fP forks a copy of itself into the background,
1257 and prints its process id if the \*(``\fB--no-kill\fP\*('' option
1258 is given.
1260 On exit, no text is written to \fB\*p\fP's output.
1261 Only an \*(``EXIT\*('' button is provided for input,
1262 but an ESC exit status may be returned.
1264 NOTE:
1265 Older versions of \fB\*p\fP forked immediately and attempted to
1266 update the screen individually.
1267 Besides being bad for performance,
1268 it was unworkable.
1269 Some older scripts may not work properly with the polled scheme.
1272 .IP "\fB--textbox \fIfile height width"
1274 \fBtext\fP
1275 box lets you display the contents of a text file in a dialog box.
1276 It is like a simple text file viewer.
1277 The user can move through the file by using the
1278 cursor, page-up, page-down
1279 and \fIHOME/END\fR keys available on most keyboards.
1280 If the lines are too long to be displayed in the box,
1281 the \fILEFT/RIGHT\fP
1282 keys can be used to scroll the text region horizontally.
1283 You may also use vi-style keys h, j, k, and l in place of the cursor keys,
1284 and B or N in place of the page-up and page-down keys.
1285 Scroll up/down using vi-style 'k' and 'j', or arrow-keys.
1286 Scroll left/right using vi-style 'h' and 'l', or arrow-keys.
1287 A '0' resets the left/right scrolling.
1288 For more convenience,
1289 vi-style forward and backward searching functions are also provided.
1291 On exit, no text is written to \fB\*p\fP's output.
1292 Only an \*(``EXIT\*('' button is provided for input,
1293 but an ESC exit status may be returned.
1296 .IP "\fB--timebox \fItext height [width hour minute second]"
1297 A dialog is displayed which allows you to select hour, minute and second.
1298 If the values for hour, minute or second are missing or negative,
1299 the current date's corresponding values are used.
1300 You can increment or decrement any of those using the
1301 left-, up-, right- and down-arrows.
1302 Use tab or backtab to move between windows.
1304 On exit, the result is printed in the form hour:minute:second.
1305 The format can be overridden using the \fB--time-format\fP option.
1308 .IP "\fB--treeview \fItext height width list-height \fR[ \fItag item status depth \fR] \fI..."
1309 Display data organized as a tree.
1310 Each group of data contains a tag,
1311 the text to display for the item,
1312 its status (\*(``on\*('' or \*(``off\*('')
1313 and the depth of the item in the tree.
1315 Only one item can be selected (like the \fBradiolist\fP).
1316 The tag is not displayed.
1318 On exit, the tag of the selected item is written to \fB\*p\fP's output.
1321 .IP "\fB--yesno \fItext height width"
1322 A \fByes/no\fP dialog box of
1323 size \fIheight\fP rows by \fIwidth\fP columns will be displayed.
1324 The string specified by
1325 \fItext\fP
1326 is displayed inside the dialog box.
1327 If this string is too long to fit
1328 in one line, it will be automatically divided into multiple lines at
1329 appropriate places.
1331 \fItext\fP
1332 string can also contain the sub-string
1333 .RI """" \en """"
1334 or newline characters
1335 .RI ` \en '
1336 to control line breaking explicitly.
1337 This dialog box is useful for
1338 asking questions that require the user to answer either yes or no.
1339 The dialog box has a
1340 \fBYes\fP
1341 button and a
1342 \fBNo\fP
1343 button, in which the user can switch between by pressing the
1344 .IR TAB " key."
1346 On exit, no text is written to \fB\*p\fP's output.
1347 In addition to the \*(``Yes\*('' and \*(``No\*('' exit codes (see DIAGNOSTICS)
1348 an ESC exit status may be returned.
1350 The codes used for \*(``Yes\*('' and \*(``No\*(''
1351 match those used for \*(``OK\*('' and \*(``Cancel\*('',
1352 internally no distinction is made.
1354 .\" ************************************************************************
1355 .SS "Obsolete Options"
1356 .\" from cdialog 0.9a (Pako)
1357 .IP "\fB--beep"
1358 This was used to tell the original cdialog that it should make a beep
1359 when the separate processes of the tailboxbg widget would repaint the screen.
1361 .\" from cdialog 0.9a (Pako)
1362 .IP "\fB--beep-after"
1363 Beep after a user has completed a widget by pressing one of the buttons.
1365 .\" ************************************************************************
1366 .SS "Whitespace Options"
1368 These options can be used to transform whitespace (space, tab, newline)
1369 as dialog reads the script:
1371 .BR --cr-wrap ,
1372 .BR --no-collapse ,
1373 .BR --no-nl-expand ", and"
1374 .B --trim
1377 The options are not independent:
1379 \fB\*L\fP checks if the script contains at least one \*(``\en\*(''
1380 and (unless \fB--no-nl-expand\fP is set) will ignore the
1381 \fB--no-collapse\fP and \fB--trim\fP options.
1383 After checking for \*(``\en\*('' and the \fB--no-nl-expand\fP option,
1384 \fB\*l\fP handles the \fB--trim\fP option.
1386 If the \fB--trim\fP option takes effect,
1387 then \fB\*l\fP ignores \fB--no-collapse\fP.
1388 It changes sequences of tabs, spaces
1389 (and newlines unless \fB-cr-wrap\fP is set) to a single space.
1391 If neither the \*(``\en\*('' or \fB--trim\fP cases apply,
1392 \fB\*l\fP checks \fB--no-collapse\fP to decide whether to reduce
1393 sequences of tabs and spaces to a single space.
1395 In this case, \fB\*l\fP ignores \fB-cr-wrap\fP and does not modify newlines.
1397 Taking those dependencies into account,
1398 here is a table summarizing the behavior
1399 for the various combinations of options.
1400 The table assumes that the script contains at least one \*(``\en\*(''
1401 when the \fB--no-nl-expand\fP option is not set.
1403 .RS 5
1405 tab(/) ;
1406 lB lB lB lB lB
1407 lB lB lB lB lB
1408 _ _ _ _ _
1409 lw5 lw5 lw5 lw5 lw30.
1410 cr-/no-/no-/trim/Result
1411 wrap/collapse/nl-expand
1412 no/no/no/no/T{
1413 Convert tab to space.
1414 Convert newline to space.
1415 Convert \*(``\en\*('' to newline.
1417 no/no/no/yes/T{
1418 Convert tab to space.
1419 Convert newline to space.
1420 Convert \*(``\en\*('' to newline.
1422 no/no/yes/no/T{
1423 Convert tab to space.
1424 Do not convert newline to space.
1425 Convert multiple-space to single.
1426 Show \*(``\en\*('' literally.
1428 no/no/yes/yes/T{
1429 Convert tab to space.
1430 Convert multiple-space to single.
1431 Convert newline to space.
1432 Show \*(``\en\*('' literally.
1434 no/yes/no/no/T{
1435 Convert newline to space.
1436 Convert \*(``\en\*('' to newline.
1438 no/yes/no/yes/T{
1439 Convert newline to space.
1440 Convert \*(``\en\*('' to newline.
1442 no/yes/yes/no/T{
1443 Do not convert newline to space.
1444 Do not reduce multiple blanks.
1445 Show \*(``\en\*('' literally.
1447 no/yes/yes/yes/T{
1448 Convert multiple-space to single.
1449 Convert newline to space.
1450 Show \*(``\en\*('' literally.
1452 yes/no/no/no/T{
1453 Convert tab to space.
1454 Wrap on newline.
1455 Convert \*(``\en\*('' to newline.
1457 yes/no/no/yes/T{
1458 Convert tab to space.
1459 Wrap on newline.
1460 Convert \*(``\en\*('' to newline.
1462 yes/no/yes/no/T{
1463 Convert tab to space.
1464 Do not convert newline to space.
1465 Convert multiple-space to single.
1466 Show \*(``\en\*('' literally.
1468 yes/no/yes/yes/T{
1469 Convert tab to space.
1470 Convert multiple-space to single.
1471 Wrap on newline.
1472 Show \*(``\en\*('' literally.
1474 yes/yes/no/no/T{
1475 Wrap on newline.
1476 Convert \*(``\en\*('' to newline.
1478 yes/yes/no/yes/T{
1479 Wrap on newline.
1480 Convert \*(``\en\*('' to newline.
1482 yes/yes/yes/no/T{
1483 Do not convert newline to space.
1484 Do not reduce multiple blanks.
1485 Show \*(``\en\*('' literally.
1487 yes/yes/yes/yes/T{
1488 Convert multiple-space to single.
1489 Wrap on newline.
1490 Show \*(``\en\*('' literally.
1496 .\" ************************************************************************
1497 .SH "RUN-TIME CONFIGURATION"
1498 .TP 4
1500 Create a sample configuration file by typing:
1503 \*p --create-rc \fIfile\fP
1505 .TP 4
1507 At start,
1508 \fB\*p\fP
1509 determines the settings to use as follows:
1511 .TP 4
1513 if environment variable
1514 \fBDIALOGRC\fP
1515 is set, its value determines the name of the configuration file.
1516 .TP 4
1518 if the file in (a) is not found, use the file
1519 \fI$HOME/.dialogrc\fP
1520 as the configuration file.
1521 .TP 4
1523 if the file in (b) is not found, try using the GLOBALRC file determined at
1524 compile-time, i.e., \fI/etc/dialogrc\fP.
1525 .TP 4
1527 if the file in (c) is not found, use compiled in defaults.
1529 .TP 4
1531 Edit the sample configuration file and copy it to some place that
1532 \fB\*p\fP
1533 can find, as stated in step 2 above.
1535 .\" ************************************************************************
1536 .SH "KEY BINDINGS"
1537 You can override or add to key bindings in \fB\*p\fP
1538 by adding to the configuration file.
1539 \fB\*L\fP's \fBbindkey\fP command maps single keys to its internal coding.
1541 bindkey \fIwidget\fP \fIcurses_key\fP \fIdialog_key\fP
1544 The \fIwidget\fP name can be \*(``*\*('' (all widgets), or
1545 specific widgets such as \fBtextbox\fP.
1546 Specific widget bindings override the \*(``*\*('' bindings.
1547 User-defined bindings override the built-in bindings.
1549 The \fIcurses_key\fP can be expressed in different forms:
1551 It may be any of the names derived from
1552 \fBcurses.h\fP, e.g., \*(``HELP\*('' from \*(``KEY_HELP\*(''.
1554 \fB\*L\fP also recognizes ANSI control characters
1555 such as \*(``^A\*('', \*(``^?\*('',
1556 as well as C1-controls such as \*(``~A\*('' and \*(``~?\*(''.
1558 Finally, \fB\*l\fP allows backslash escapes as in C.
1559 Those can be octal character values such as \*(``\\033\*(''
1560 (the ASCII escape character), 
1561 or the characters listed in this table:
1562 .RS 10
1564 tab(/) ;
1565 lI lI
1566 _ _
1567 l l .
1568 Escaped/Actual
1569 \\b/backspace
1570 \\f/form feed
1571 \\n/new line (line feed)
1572 \\r/carriage return
1573 \\s/space
1574 \\t/tab
1575 \\^/\*(``^\*('' (caret)
1576 \\?/\*(``?\*('' (question mark)
1577 \\\\/\*(``\\\*('' (backslash)
1582 \fB\*L\fP's internal keycode names correspond to the
1583 \fBDLG_KEYS_ENUM\fP type in
1584 \fBdlg_keys.h\fP, e.g., \*(``HELP\*('' from \*(``DLGK_HELP\*(''.
1585 .SS Widget Names
1587 Some widgets (such as the formbox) have an area where fields can be edited.
1588 Those are managed in a subwindow of the widget, and
1589 may have separate keybindings from the main widget
1590 because the subwindows are registered using a different name.
1591 .RS 5
1593 tab(/) ;
1594 lI lI lI
1595 _ _ _
1596 l l l .
1597 Widget/Window name/Subwindow Name
1598 calendar/calendar
1599 checklist/checklist
1600 editbox/editbox/editbox2
1601 form/formbox/formfield
1602 fselect/fselect/fselect2
1603 inputbox/inputbox/inputbox2
1604 menu/menubox/menu
1605 msgbox/msgbox
1606 pause/pause
1607 progressbox/progressbox
1608 radiolist/radiolist
1609 tailbox/tailbox
1610 textbox/textbox/searchbox
1611 timebox/timebox
1612 yesno/yesno
1617 Some widgets are actually other widgets,
1618 using internal settings to modify the behavior.
1619 Those use the same widget name as the actual widget:
1620 .RS 5
1622 tab(/) ;
1623 lI lI
1624 _ _
1625 l l .
1626 Widget/Actual Widget
1627 dselect/fselect
1628 infobox/msgbox
1629 inputmenu/menu
1630 mixedform/form
1631 passwordbox/inputbox
1632 passwordform/form
1633 prgbox/progressbox
1634 programbox/progressbox
1635 tailboxbg/tailbox
1639 .SS Built-in Bindings
1640 This manual page does not list the key bindings for each widget,
1641 because that detailed information can be obtained by running \fB\*p\fP.
1642 If you have set the \fB--trace\fP option,
1643 \fB\*p\fP writes the key-binding information for each widget
1644 as it is registered.
1645 .SS Example
1646 Normally \fB\*p\fP uses different keys for navigating between the buttons
1647 and editing part of a dialog versus navigating within the editing part.
1648 That is, tab (and back-tab) traverse buttons
1649 (or between buttons and the editing part),
1650 while arrow keys traverse fields within the editing part.
1651 Tabs are also recognized as a special case for traversing between
1652 widgets, e.g., when using multiple tailboxbg widgets.
1654 Some users may wish to use the same key for traversing within the
1655 editing part as for traversing between buttons.
1656 The form widget is written to support this sort of redefinition of
1657 the keys, by adding a special group in \fBdlgk_keys.h\fP
1658 for \*(``form\*('' (left/right/next/prev).
1659 Here is an example binding demonstrating how to do this:
1661 bindkey formfield TAB  form_NEXT
1662 bindkey formbox   TAB  form_NEXT
1663 bindkey formfield BTAB form_prev
1664 bindkey formbox   BTAB form_prev
1667 That type of redefinition would not be useful in other widgets,
1668 e.g., calendar, due to the potentially large number of fields to traverse.
1670 .\" ************************************************************************
1671 .SH ENVIRONMENT
1672 .TP 15
1673 \fBDIALOGOPTS\fP
1674 Define this variable to apply any of the common options to each widget.
1675 Most of the common options are reset before processing each widget.
1676 If you set the options in this environment variable,
1677 they are applied to \fB\*p\fP's state after the reset.
1678 As in the \*(``\fB--file\fP\*('' option,
1679 double-quotes and backslashes are interpreted.
1681 The \*(``\fB--file\fP\*('' option is not considered a common option
1682 (so you cannot embed it within this environment variable).
1683 .TP 15
1684 \fBDIALOGRC\fP
1685 Define this variable if you want to specify the name of the configuration file
1686 to use.
1687 .TP 15
1688 \fBDIALOG_CANCEL\fP
1689 .TP 15
1690 \fBDIALOG_ERROR\fP
1691 .TP 15
1692 \fBDIALOG_ESC\fP
1693 .TP 15
1694 \fBDIALOG_EXTRA\fP
1695 .TP 15
1696 \fBDIALOG_HELP\fP
1697 .TP 15
1698 \fBDIALOG_ITEM_HELP\fP
1699 .TP 15
1700 \fBDIALOG_OK\fP
1701 Define any of these variables to change the exit code on
1702 Cancel (1),
1703 error (\-1),
1704 ESC (255),
1705 Extra (3),
1706 Help (2),
1707 Help with \fB--item-help\fP (2),
1708 or OK (0).
1709 Normally shell scripts cannot distinguish between \-1 and 255.
1710 .TP 15
1711 \fBDIALOG_TTY\fP
1712 Set this variable to \*(``1\*('' to provide compatibility with older versions
1713 of \fB\*p\fP which assumed that if the script redirects the standard output,
1714 that the \*(``\fB--stdout\fP\*('' option was given.
1715 .SH FILES
1716 .TP 20
1717 \fI$HOME/.dialogrc\fP
1718 default configuration file
1719 .SH EXAMPLES
1720 The \fB\*p\fP sources contain several samples
1721 of how to use the different box options and how they look.
1722 Just take a look into the directory \fBsamples/\fP of the source.
1723 .SH DIAGNOSTICS
1724 Exit status is subject to being overridden by environment variables.
1725 The default values and corresponding environment variables
1726 that can override them are:
1727 .TP 5
1729 if the \fBYES\fP or \fBOK\fP button is pressed (DIALOG_OK).
1730 .TP 5
1732 if the
1733 .BR No " or " Cancel
1734 button is pressed (DIALOG_CANCEL).
1735 .TP 5
1737 if the
1738 .B Help
1739 button is pressed (DIALOG_HELP),
1741 except as noted below about DIALOG_ITEM_HELP.
1742 .TP 5
1744 if the
1745 .B Extra
1746 button is pressed (DIALOG_EXTRA).
1747 .TP 5
1749 if the
1750 .B Help
1751 button is pressed,
1753 and the \fB--item-help\fP option is set
1755 and the DIALOG_ITEM_HELP environment variable is set to 4.
1757 While any of the exit-codes can be overridden using environment variables,
1758 this special case was introduced in 2004 to simplify compatibility.
1759 \fB\*L\fP uses DIALOG_ITEM_HELP(4) internally,
1760 but unless the environment variable is also set,
1761 it changes that to DIALOG_HELP(2) on exit.
1762 .TP 5
1764 if errors occur inside \fB\*p\fP (DIALOG_ERROR)
1765 or \fB\*p\fP exits because the \fIESC\fP key (DIALOG_ESC) was pressed.
1767 .\" ************************************************************************
1768 .SH PORTABILITY
1769 \fB\*L\fP works with X/Open curses.
1770 However, some implementations have deficiencies:
1771 .RS 3
1773 HPUX curses (and perhaps others) do not open the terminal properly for
1774 the \fInewterm\fP function.
1775 This interferes with \fB\*p\fP's \fB--input-fd\fP option,
1776 by preventing cursor-keys and similar escape sequences from being recognized.
1778 NetBSD 5.1 curses has incomplete support for wide-characters.
1779 \fB\*p\fP will build, but not all examples display properly.
1781 .\" ************************************************************************
1782 .SH COMPATIBILITY
1783 You may want to write scripts which run with
1784 other \fB\*l\fP \*(``clones\*(''.
1785 .SS Original Dialog
1786 First, there is the \*(``original\*('' \fB\*p\fP program to consider
1787 (versions 0.3 to 0.9).
1788 It had some misspelled (or inconsistent) options.
1789 The \fB\*p\fP program maps those deprecated options to the preferred ones.
1790 They include:
1793 tab(/) ;
1794 lI lI
1795 _ _
1796 l l.
1797 Option/Treatment
1798 \fB--beep-after\fP/ignored
1799 \fB--guage\fP/mapped to \fB--gauge\fP
1803 .SS Xdialog
1804 This is an X application, rather than a terminal program.
1805 With some care, it is possible to write useful scripts that work
1806 with both \fBXdialog\fP and \fB\*p\fP.
1808 The \fB\*p\fP program ignores these options which are recognized
1809 by \fBXdialog\fP:
1812 tab(/) ;
1813 lI lI
1814 _ _
1815 l l.
1816 Option/Treatment
1817 \fB--allow-close\fP/ignored
1818 \fB--auto-placement\fP/ignored
1819 \fB--fixed-font\fP/ignored
1820 \fB--icon\fP/ignored
1821 \fB--keep-colors\fP/ignored
1822 \fB--no-close\fP/ignored
1823 \fB--no-cr-wrap\fP/ignored
1824 \fB--screen-center\fP/ignored
1825 \fB--separator\fP/mapped to \fB--separate-output\fP
1826 \fB--smooth\fP/ignored
1827 \fB--under-mouse\fP/ignored
1828 \fB--wmclass\fP/ignored
1833 \fBXdialog\fP's manpage has a section discussing its compatibility
1834 with \fB\*p\fP.
1835 There are some differences not shown in the manpage.
1836 For example, the html documentation states
1839 Note: former Xdialog releases used the \*(``\en\*('' (line feed) as a
1840 results separator for the checklist widget;
1841 this has been changed to \*(``/\*('' in Xdialog v1.5.0
1842 to make it compatible with (c)dialog.
1843 In your old scripts using the Xdialog checklist, you
1844 will then have to add the \fB--separate-output\fP option before the
1845 \fB--checklist\fP one.
1848 \fB\*L\fP has not used a different separator;
1849 the difference was likely due to confusion regarding some script.
1850 .SS Whiptail
1851 Then there is \fBwhiptail\fP.
1852 For practical purposes, it is maintained by Debian
1853 (very little work is done by its upstream developers).
1854 Its documentation (README.whiptail) claims
1856 whiptail(1) is a lightweight replacement for \*p(1),
1857 to provide dialog boxes for shell scripts.
1858 It is built on the
1859 newt windowing library rather than the ncurses library, allowing
1860 it to be smaller in embedded environments such as installers,
1861 rescue disks, etc.
1863 whiptail is designed to be drop-in compatible with \*p, but
1864 has less features: some dialog boxes are not implemented, such
1865 as tailbox, timebox, calendarbox, etc.
1868 Comparing actual sizes (Debian testing, 2007/1/10):
1869 The total of sizes for \fBwhiptail\fP,
1870 the newt, popt and slang libraries is 757\ KB.
1871 The comparable number for \fB\*p\fP (counting ncurses) is 520\ KB.
1872 Disregard the first paragraph.
1874 The second paragraph is misleading, since \fBwhiptail\fP
1875 also does not work for common options of \fB\*p\fP,
1876 such as the gauge box.
1877 \fBwhiptail\fP is less compatible with \fB\*p\fP than the
1878 original mid-1990s dialog 0.4 program.
1880 \fBwhiptail\fP's manpage borrows features from \fB\*p\fP, e.g.,
1881 but oddly cites only \fB\*p\fP versions up to 0.4 (1994) as a source.
1882 That is, its manpage refers to features which
1883 were borrowed from more recent versions of \fB\*p\fP, e.g.,
1885 \fB--gauge\fP (from 0.5)
1887 \fB--passwordbox\fP (from Debian changes in 1999),
1889 \fB--default-item\fP (from \fB\*p\fP 2000/02/22),
1891 \fB--output-fd\fP (from \fB\*p\fP 2002/08/14).
1893 Somewhat humorously, one may note that the \fBpopt\fP feature
1894 (undocumented in its manpage)
1895 of using a \*(``--\*('' as an escape was documented in \fB\*p\fP's manpage about
1896 a year before it was mentioned in \fBwhiptail\fP's manpage.
1897 \fBwhiptail\fP's manpage incorrectly attributes that to \fBgetopt\fP
1898 (and is inaccurate anyway).
1900 Debian uses \fBwhiptail\fP for the official \fB\*p\fP variation.
1902 The \fB\*p\fP program ignores or maps these options which are recognized
1903 by \fBwhiptail\fP:
1906 tab(/) ;
1907 lI lI
1908 _ _
1909 l l.
1910 Option/Treatment
1911 \fB--cancel-button\fP/mapped to \fB--cancel-label\fP
1912 \fB--fb\fP/ignored
1913 \fB--fullbutton\fP/ignored
1914 \fB--no-button\fP/mapped to \fB--no-label\fP
1915 \fB--nocancel\fP/mapped to \fB--no-cancel\fP
1916 \fB--noitem\fP/mapped to \fB--no-items\fP
1917 \fB--notags\fP/mapped to \fB--no-tags\fP
1918 \fB--ok-button\fP/mapped to \fB--ok-label\fP
1919 \fB--scrolltext\fP/mapped to \fB--scrollbar\fP
1920 \fB--topleft\fP/mapped to \fB--begin 0 0\fP
1921 \fB--yes-button\fP/mapped to \fB--yes-label\fP
1926 There are visual differences which are not addressed by command-line options:
1928 \fB\*p\fP centers lists within the window.
1929 \fBwhiptail\fP typically puts lists against the left margin.
1931 \fBwhiptail\fP uses angle brackets (\*(``<\*('' and \*(``>\*('')
1932 for marking buttons.
1933 \fB\*p\fP uses square brackets.
1935 \fBwhiptail\fP marks the limits of subtitles with vertical bars.
1936 \fB\*p\fP does not mark the limits.
1938 \fBwhiptail\fP attempts to mark the top/bottom cells of a scrollbar
1939 with up/down arrows.
1940 When it cannot do this,
1941 it fills those cells with the background color
1942 of the scrollbar and confusing the user.
1943 \fB\*p\fP uses the entire scrollbar space,
1944 thereby getting better resolution.
1945 .\" ************************************************************************
1946 .SH BUGS
1947 Perhaps.
1948 .SH AUTHOR
1950 Thomas E.\& Dickey (updates for 0.9b and beyond)
1951 .SH CONTRIBUTORS
1952 Kiran Cherupally \(en the mixed form and mixed gauge widgets.
1954 Tobias C.\& Rittweiler
1956 Valery Reznic \(en the form and progressbox widgets.
1958 Yura Kalinichenko adapted the gauge widget as \*(``pause\*(''.
1960 This is a rewrite (except as needed to provide compatibility)
1961 of the earlier version of \fB\*p 0.9a\fP,
1962 which lists as authors:
1964 Savio Lam \(en version 0.3, \*(``dialog\*(''
1966 Stuart Herbert \(en patch for version 0.4
1968 Marc Ewing \(en the gauge widget.
1970 Pasquale De Marco \*(``Pako\*('' \(en version 0.9a, \*(``cdialog\*(''