diff options
Diffstat (limited to 'usr.bin/tput/tput.1')
-rw-r--r-- | usr.bin/tput/tput.1 | 81 |
1 files changed, 53 insertions, 28 deletions
diff --git a/usr.bin/tput/tput.1 b/usr.bin/tput/tput.1 index b9476a52da0..0a04e4b4627 100644 --- a/usr.bin/tput/tput.1 +++ b/usr.bin/tput/tput.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tput.1,v 1.6 1999/06/05 01:21:44 aaron Exp $ +.\" $OpenBSD: tput.1,v 1.7 1999/06/29 19:39:40 millert Exp $ .\" $NetBSD: tput.1,v 1.4 1994/12/07 08:49:10 jtc Exp $ .\" .\" Copyright (c) 1989, 1990, 1993 @@ -34,7 +34,7 @@ .\" .\" @(#)tput.1 8.2 (Berkeley) 3/19/94 .\" -.Dd March 19, 1994 +.Dd June 29, 1999 .Dt TPUT 1 .Os .Sh NAME @@ -46,6 +46,9 @@ .Ar attribute .Op Ar attribute-args .Ar ... +.Nm tput +.Op Fl T Ar term +.Fl S .Sh DESCRIPTION .Nm tput makes terminal-dependent information available to users or shell @@ -54,29 +57,41 @@ The options are as follows: .Bl -tag -width Ds .It Fl T The terminal name as specified in the -.Xr termcap +.Xr terminfo database, for example, ``vt100'' or ``xterm''. If not specified, .Nm tput retrieves the .Dq Ev TERM variable from the environment. +.It Fl S +The +.Ar attributes +are read from stdin instead of from the command line. .El .Pp .Nm tput outputs a string if the .Ar attribute is of type string; a number if it is of type integer. -Otherwise, +If the +.Ar attribute +is of type boolean, .Nm tput -exits 0 if the terminal has the capability and 1 if it does not, -without further action. +exits 0 if the terminal has the capability and 1 if it +does not. Each +.Ar attribute +should be a string defined in either +.Xr terminfo 5 +or +.Xr termcap 5 . .Pp If the .Ar attribute is of type string, and takes arguments (e.g. cursor movement, -the termcap -.Dq cm +the +.Xr terminfo +.Dq cup sequence) the arguments are taken from the command line immediately following the attribute. .Pp @@ -84,41 +99,51 @@ The following special attributes are available: .Bl -tag -width Ar .It clear Clear the screen (the -.Xr termcap -``cl'' sequence). +.Xr terminfo +``clear'' sequence). .It init -Initialize the terminal (the -.Xr termcap -``is'' sequence). +Print the +.Xr terminfo +initialization strings for the specified terminal. .It longname Print the descriptive name of the user's terminal type. .It reset -Reset the terminal (the -.Xr termcap -``rs'' sequence). +Reset the terminal (using the +.Xr terminfo +reset sequences). .Sh DIAGNOSTICS The exit value of .Nm tput is based on the last attribute specified. -If the attribute is of type string or of type integer, -.Nm tput -exits 0 if the attribute is defined for this terminal type and 1 -if it is not. +If the attribute is of type string or of type integer the exit +value is as follows: +.Bl -tag -offset indent -width Ds -compact +.It 0 +The requested string was written successfully. +.It 2 +Usage error. +.It 3 +Unknown terminal type. +.It 4 +Unknown attribute name. +.It >4 +An error occurred. +.El +.Pp If the attribute is of type boolean, .Nm tput -exits 0 if the terminal has this attribute, and 1 if it does not. -.Nm tput -exits 2 if any error occurred. +exits with a value of 0 if the terminal has this attribute, and +1 if it does not. .Sh EXAMPLES -.Bl -tag -width "tput cm 6 11 DC 6" -compact -.It Li "tput cl cm 5 10" +.Bl -tag -width "tput cup 6 11 dch 6" -compact +.It Li "tput clear cup 5 10" clear the screen and goto line 5 column 10 .Pp -.It Li "tput cm 6 11 DC 6" +.It Li "tput cup 6 11 dch 6" goto line 6 column 11 and delete 6 characters .Sh SEE ALSO -.Xr termcap 3 , -.Xr termcap 5 +.Xr terminfo 3 , +.Xr terminfo 5 .Sh BUGS .Nm tput can't really distinguish between different types of attributes. |