Files

117 lines
2.7 KiB
Groff

.TH mask "" "" "/rdb Command"
.PC "Full-screen input form that writes a table row"
\fBmask \fB[ -b ] [ -s ] [ \fIform\fB ] < \fIform \fB> \fItable\fR
.PP
.II "mask^input form"
.II "form^full-screen input"
.I "(Ruby re-creation only; the original /rdb has no such command.)"
.PP
The command
.B mask
draws
.I form
on the terminal, lets the user fill in its fields, and writes the result as
a one-row table on the standard output.
Unlike
.BR screen ,
it does not write a shell script: it runs the form itself.
The screen is drawn on
.BR /dev/tty ,
so the table can be redirected or piped:
.DM
mask < maskform > newrow
mask < maskform | append -h customer
.DE
.PP
.I form
is ordinary text.
Everything is shown as it stands, except:
.IP "\fB<Column>\fR" 1.2i
An input field for column
.IR Column .
It is as wide as the text between the angle brackets, including the brackets.
Blanks around the name are ignored, so \fB< City >\fR is column \fBCity\fR.
.IP "\fB<Column:20>\fR"
The same, but 20 characters wide.
Longer input scrolls inside the field.
.IP "\fB[ Save ]\fR"
A button.
A button whose label is
.BR Cancel ,
.BR Abort ,
.B Quit
or
.B Abbrechen
cancels; any other button accepts.
.IP "\fB<!command!>\fR"
Replaced by the first line the shell
.I command
writes.
.PP
If a column occurs more than once in the form, it is one field,
and every place shows what was typed.
The table has one column per field, in the order of first appearance.
Frames are made of characters in the form, for example \fB+---+\fR or
box-drawing characters.
.SH Keys
.nf
Tab, Down, Enter next field or button
Shift-Tab, Up previous field or button
Left, Right, Home, End move inside a field
Backspace, Delete erase; Ctrl-U clears the field
Enter, Space on a button: press it
Enter on the last field of a form without buttons: accept
Esc, Ctrl-C cancel
.fi
.PP
When the user cancels,
.B mask
writes nothing and exits with status 1.
.SH Options
.IP \fB-b\fR 0.5i
Draw a frame around the whole form.
.IP \fB-s\fR
Show the form as a plain picture (fields as underscores) with the position of
each field and button, and exit.
This needs no terminal and is useful to check a form.
.PP
Like
.BR screen ,
.B mask
reads the form from the standard input.
A file name argument is also accepted, and
.B -
means the standard input.
.SH Example
Form
.BR maskform :
.DM
Mail List Entry
Name : <Name:24>
City : <City:16> State: <State:10>
[ Save ] [ Cancel ]
.DE
.PP
.DM
mask -b < maskform > newrow
.DE
.PP
After typing ``Ann'' and ``Rome'', pressing Tab to the buttons and Enter on
.BR Save ,
.B newrow
contains:
.DM
Name City State
---- ---- -----
Ann Rome
.DE
.SH "See Also"
.B
cursor,
report,
screen
.R
.SO rdb