From 2393bfe754c416ce7456ad893ae152214a396f76 Mon Sep 17 00:00:00 2001 From: Miloslav Trmac Date: Wed, 25 Jan 2006 17:59:55 +0000 Subject: Add man page for getkey. --- src/getkey.1 | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 src/getkey.1 (limited to 'src/getkey.1') diff --git a/src/getkey.1 b/src/getkey.1 new file mode 100644 index 00000000..d445c398 --- /dev/null +++ b/src/getkey.1 @@ -0,0 +1,80 @@ +.\" A man page for getkey(1). -*- nroff -*- +.\" +.\" Copyright (C) 2006 Red Hat, Inc. All rights reserved. +.\" +.\" This copyrighted material is made available to anyone wishing to use, +.\" modify, copy, or redistribute it subject to the terms and conditions of the +.\" GNU General Public License v.2. +.\" +.\" This program is distributed in the hope that it will be useful, but WITHOUT +.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +.\" more details. +.\" +.\" You should have received a copy of the GNU General Public License along +.\" with this program; if not, write to the Free Software Foundation, Inc., +.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +.\" +.\" Author: Miloslav Trmac +.TH getkey 1 "Jan 2006" + +.SH NAME +getkey \- wait until a key is pressed + +.SH SYNOPSIS +\fBgetkey\fR [\fIOPTION\fR]... [\fIKEYS\fR] + +.SH DESCRIPTION +.B getkey +waits until one of +.I KEYS +is pressed. +If +.I KEYS +are not specified, any key is accepted. +.I KEYS +are matched case-insensitive. + +.SH EXIT STATUS +.B getkey +exits with status 0 if one of the expected keys is pressed. +If invalid arguments are specified, +.B getkey +exits with status 255. +If +.B getkey +is interrupted or the wait times out, +.B getkey +exits with other non-zero status. + +.SH OPTIONS +.TP +\fB\-c\fR, \fB\-\-wait\fR \fISECONDS\fR +Wait only for +.I SECONDS +seconds. +The default is 0, which means to wait without a time limit. + +.TP +\fB\-i\fR, \fB\-\-ignore\-control\-chars\fR +Don't treat Ctrl+C and Ctrl+D specially. +When this option is not specified, these characters interrupt \fBgetkey\fR. + +.TP +\fB\-m\fR, \fB\-\-message\fR \fIMESSAGE\fR +Display +.I MESSAGE +while waiting. +The message is used as a format string in +.BR sprintf (8), +with a single argument, the number of seconds left. +Typical usage is therefore +\fB"Press a key within %d seconds to ..."\fR. +If +.I MESSAGE +contains other format string directives, the behavior is undefined and +.B getkey +may crash. + +If there is no time limit specified, +the number of seconds left is reported as 0. -- cgit v1.2.1