=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/less/less.1,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- src/usr.bin/less/less.1 2014/04/07 17:33:57 1.31 +++ src/usr.bin/less/less.1 2014/04/25 13:38:21 1.32 @@ -1,6 +1,6 @@ -.\" $OpenBSD: less.1,v 1.31 2014/04/07 17:33:57 millert Exp $ +.\" $OpenBSD: less.1,v 1.32 2014/04/25 13:38:21 shadchin Exp $ .\" -.\" Copyright (C) 1984-2011 Mark Nudelman +.\" Copyright (C) 1984-2012 Mark Nudelman .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 7 2014 $ +.Dd $Mdocdate: April 25 2014 $ .Dt LESS 1 .Os .Sh NAME @@ -155,6 +155,10 @@ It is a way to monitor the tail of a file which is growing while it is being viewed. (The behavior is similar to the "tail -f" command.) +.It Ic ESC-F +Like F, but as soon as a line is found which matches +the last search pattern, the terminal bell is rung +and forward scrolling stops. .It Ic g | < | ESC-< Go to line N in the file, default 1 (beginning of file). (Warning: this may be slow if N is large.) @@ -514,12 +518,19 @@ variable, it can be reset to its default value on the command line by beginning the command line option with "\-+". .Pp -For options like -P which take a following string, -a dollar sign ($) must be used to signal the end of the string. +Some options like -k require a string to follow the option letter. +The string for that option is considered to end when a dollar sign ($) is found. For example, to separate a prompt value from any other options with dollar sign between them: .Pp .Dl LESS="-Ps--More--$-C -e" +.Pp +If the --use-backslash option appears earlier in the options, then +a dollar sign or backslash may be included literally in an option string +by preceding it with a backslash. +If the --use-backslash option is not in effect, then backslashes are +not treated specially, and there is no way to include a dollar sign +in the option string. .Bl -tag -width XXXX .It Fl \&? | -help This option displays a summary of the commands accepted by @@ -855,10 +866,11 @@ Thus, various display problems may result, such as long lines being split in the wrong place. .It Fl S | -chop-long-lines -Causes lines longer than the screen width to be chopped rather than folded. +Causes lines longer than the screen width to be +chopped (truncated) rather than wrapped. That is, the portion of a long line that does not fit in the screen width is not shown. -The default is to fold long lines; that is, display the remainder +The default is to wrap long lines; that is, display the remainder on the next line. .It Fl s | -squeeze-blank-lines Causes consecutive blank lines to be squeezed into a single blank line. @@ -987,6 +999,11 @@ to the terminal. This is sometimes useful if the keypad strings make the numeric keypad behave in an undesirable manner. +.It Fl -use-backslash +This option changes the interpretations of options which follow this one. +After the --use-backslash option, any backslash in an option string is +removed and the following character is taken literally. +This allows a dollar sign to be included in option strings. .It Xo .Ar -cc | .Fl -quotes Ns = Ns Ar cc @@ -1079,8 +1096,12 @@ Delete the word under the cursor. .It UPARROW [ ESC-k ] Retrieve the previous command line. +If you first enter some text and then press UPARROW, +it will retrieve the previous command which begins with that text. .It DOWNARROW [ ESC-j ] Retrieve the next command line. +If you first enter some text and then press DOWNARROW, +it will retrieve the next command which begins with that text. .It TAB Complete the partial filename to the left of the cursor. If it matches more than one filename, the first match @@ -1271,12 +1292,33 @@ #! /bin/sh case "$1" in *.Z) uncompress -c $1 2>/dev/null +*) exit 1 ;; esac +exit $? .Ed .Pp To use this script, put it where it can be executed and set LESSOPEN="|lesspipe.sh %s". +.Pp +Note that a preprocessor cannot output an empty file, since that +is interpreted as meaning there is no replacement, and +the original file is used. +To avoid this, if +.Ev LESSOPEN +starts with two vertical bars, +the exit status of the script becomes meaningful. +If the exit status is zero, the output is considered to be +replacement text, even if it empty. +If the exit status is nonzero, any output is ignored and the +original file is used. +For compatibility with previous versions of +.Nm less , +if +.Ev LESSOPEN +starts with only one vertical bar, the exit status +of the preprocessor is ignored. +.Pp When an input pipe is used, a LESSCLOSE postprocessor can be used, but it is usually not necessary since there is no replacement file to clean up. In this case, the replacement file name passed to the LESSCLOSE @@ -1294,7 +1336,8 @@ If standard input is being viewed, the input preprocessor is passed a file name consisting of a single dash. Similarly, if the first two characters of LESSOPEN are vertical bar and dash -(|-), the input pipe is used on standard input as well as other files. +(|-) or two vertical bars and a dash (||-), +the input pipe is used on standard input as well as other files. Again, in this case the dash is not considered to be part of the input pipe command. .Sh NATIONAL CHARACTER SETS @@ -1809,6 +1852,12 @@ (But if you have a windowing system which supports TIOCGWINSZ or WIOCGETD, the window system's idea of the screen size takes precedence over the LINES and COLUMNS environment variables.) +.It Ev MORE +Options which are passed to +.Nm +automatically when running in +.Nm more +compatible mode. .\" .It Ev PATH .\" User's search path (used to find a lesskey file .\" on MS-DOS and OS/2 systems). @@ -1835,9 +1884,9 @@ .Op Fl aBbCdEFfGghIJjkLMmNOoPQqRrSTUVWwXxyz~# are extensions to that specification. .Sh AUTHORS -.An Mark Nudelman Aq Mt markn@greenwoodsoftware.com +.An Mark Nudelman .Pp -Send bug reports or comments to the above address or to +Send bug reports or comments to .Aq Mt bug\-less@gnu.org . .Pp For more information, see the less homepage at