aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiloslav Trmac <mitr@volny.cz>2006-01-25 17:59:55 +0000
committerMiloslav Trmac <mitr@volny.cz>2006-01-25 17:59:55 +0000
commit2393bfe754c416ce7456ad893ae152214a396f76 (patch)
treed3e71d3d90db0bf7782ab3ff005bed063082d957
parent8542d5743685412b5517efb77d4fc6d0bf44bae4 (diff)
downloadinitscripts-2393bfe754c416ce7456ad893ae152214a396f76.tar
initscripts-2393bfe754c416ce7456ad893ae152214a396f76.tar.gz
initscripts-2393bfe754c416ce7456ad893ae152214a396f76.tar.bz2
initscripts-2393bfe754c416ce7456ad893ae152214a396f76.tar.xz
initscripts-2393bfe754c416ce7456ad893ae152214a396f76.zip
Add man page for getkey.
-rw-r--r--src/Makefile1
-rw-r--r--src/getkey.180
2 files changed, 81 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile
index 836ae70b..c691870b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -28,6 +28,7 @@ install:
install -m 644 initlog.1 $(ROOT)$(mandir)/man1
install -m 644 genhostid.1 $(ROOT)$(mandir)/man1
install -m 644 doexec.1 $(ROOT)$(mandir)/man1
+ install -m 644 getkey.1 $(ROOT)$(mandir)/man1
install -m 644 netreport.1 $(ROOT)$(mandir)/man1
install -m 644 usleep.1 $(ROOT)$(mandir)/man1
install -m 644 usernetctl.8 $(ROOT)$(mandir)/man8
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 <mitr@redhat.com>
+.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.