Expunge revision histories in files.
[xtoys] / xgetline.1
CommitLineData
b6eb57e6 1.\" -*-nroff-*-
ec19d7af 2.TH xgetline 1 "15 November 1998" "Straylight/Edgeware" "xtoys"
90b2c5d4 3.SH NAME
4xgetline \- request a line of text in an X dialogue box
5.SH SYNOPSIS
6.B xgetline
0a47c222 7.RB [ -in ]
90b2c5d4 8.RB [ \-t
9.IR title ]
10.RB [ \-p
11.IR prompt ]
12.RB [ \-d
13.IR default ]
0a47c222 14.RB [ \-l | \-H
15.IR file ]
16.RB [ \- m
17.IR max ]
90b2c5d4 18.SH DESCRIPTION
19The
20.B xgetline
21program reads a line of text from the user via a pretty GTK dialogue
22box. The title bar contents, prompt string, and default text are all
23configurable. If the user enters a string and clicks the
24.B OK
25button (or
26presses
27.IR enter ),
28the string is echoed to standard output and
29.B xgetline
30returns an exit status of zero. If the user cancels the dialogue box
31(by closing it, or pressing
32.IR escape ),
33.B xgetline
34echoes nothing and returns an exit status of one.
35.PP
36The
37.B xgetline
38program is intended to be used in window manager configuration files, to
39allow users to fill in bits of text (e.g., hostnames or shell commands)
40in generally useful places. For example, the author has the following
41shell command attached to a hotkey:
42.PP
43.RS 5
44.ft B
45.nf
46cmd=`xgetline -t "Shell command in window" -p "Command:"` &&
47 xterm -T "$cmd" -e sh -c "$cmd"
48.ft R
49.fi
e571b0f1 50.SS Options
90b2c5d4 51.TP 5
f3b35b6b 52.B \-i, \-\-invisible
53Don't echo characters to the screen when they're typed. Useful when
54requesting passwords and similar secrets.
55.TP 5
90b2c5d4 56.BI "\-t, \-\-title " title
57Sets the title of the dialogue box to
58.IR title .
59The default title is
60.RB ` "Input request" '.
61.TP 5
62.BI "\-p, \-\-prompt " prompt
63Sets the prompt string in the dialogue box to
64.IR prompt .
65The default is to have no prompt string.
66.TP 5
67.BI "\-d, \-\-default " default
68Sets the default text in the entry field to
69.IR default .
0a47c222 70The default default is the first item in the empty string. The special
71default string
72.RB ` @ '
73sets the default to be the first item in the history list, if one is
74supplied.
75.TP 5
76.BI "\-l, \-\-list " file
77Reads a list of alternatives from
78.I file
79and displays them in a drop-down list box. The user can rapidly select
80an item from the drop-down list using the mouse or cursor keys. The
81file is not modified (but see the
82.B \-\-history
83option below).
84.TP 5
85.B "\-n, \-\-no-choice"
86One of the items from the selection list must be chosen; the user may
87not type an entry in directly.
88.TP 5
89.BI "\-H, \-\-history " file
90Reads a file and displays the contents in a drop-down list, as for
91.B \-\-list
92above. Once the user has entered a string, a new list written to
93.I file
94containing the newly entered string as the first item; other lines
95matching the newly entered string are not written.
96.TP 5
97.BI "\-m, \-\-histmax " max
98When writing an updated history file, do not write more than
99.I max
100lines. The default is 20; a value of 0 disables a length limit on the
101history file.
90b2c5d4 102.SH AUTHOR
103Mark Wooding (mdw@nsict.org).
104.SH BUGS
105Hopefully none.