From: millert Date: Tue, 29 Apr 2014 12:11:25 +0000 (+0000) Subject: Remove support for the obsolete (non-POSIX) "more -d" prompt. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=67b9fbdc2196e5cc7868d219efe581f3c7dd496f;p=openbsd Remove support for the obsolete (non-POSIX) "more -d" prompt. This was a local change that was only enabled when the LESS_IS_MORE environment variable was set and not when invoked as "more". OK shadchin@ jmc@ --- diff --git a/usr.bin/less/command.c b/usr.bin/less/command.c index 7ade9600123..3666d56ecff 100644 --- a/usr.bin/less/command.c +++ b/usr.bin/less/command.c @@ -54,7 +54,6 @@ extern int screen_trashed; /* The screen has been overwritten */ extern int shift_count; extern int oldbot; extern int forw_prompt; -extern int be_helpful; extern int less_is_more; #if SHELL_ESCAPE @@ -70,7 +69,6 @@ static int optflag; static int optgetname; static POSITION bottompos; static int save_hshift; -static char *help_prompt; #if PIPEC static char pipec; #endif @@ -750,7 +748,7 @@ prompt() clear_bot(); clear_cmd(); forw_prompt = 0; - p = help_prompt ? help_prompt : pr_string(); + p = pr_string(); if (is_filtering()) putstr("& "); if (p == NULL || *p == '\0') @@ -759,11 +757,8 @@ prompt() { at_enter(AT_STANDOUT); putstr(p); - if (be_helpful && !help_prompt && strlen(p) + 40 < sc_width) - putstr(" [Press space to continue, 'q' to quit.]"); at_exit(); } - help_prompt = NULL; clear_eol(); } @@ -1812,10 +1807,7 @@ commands() break; default: - if (be_helpful) - help_prompt = "[Press 'h' for instructions.]"; - else - bell(); + bell(); break; } } diff --git a/usr.bin/less/less.1 b/usr.bin/less/less.1 index 801261328c7..9b8b0f0d4e7 100644 --- a/usr.bin/less/less.1 +++ b/usr.bin/less/less.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: less.1,v 1.32 2014/04/25 13:38:21 shadchin Exp $ +.\" $OpenBSD: less.1,v 1.33 2014/04/29 12:11:25 millert Exp $ .\" .\" Copyright (C) 1984-2012 Mark Nudelman .\" @@ -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 25 2014 $ +.Dd $Mdocdate: April 29 2014 $ .Dt LESS 1 .Os .Sh NAME @@ -589,7 +589,7 @@ Causes full screen repaints to be painted from the bottom of the screen. By default, full screen repaints are done from the top line down to avoid the position of the display being moved when using interactive commands. -.It Fl d | -dumb No (less only) +.It Fl d | -dumb The -d option suppresses the error message normally displayed if the terminal is dumb; that is, lacks some important capability, @@ -599,13 +599,6 @@ The -d option does not otherwise change the behavior of on a dumb terminal. This option is on by default when invoked as .Nm more . -.It Fl d No (more only) -The -d option causes the default prompt to include the -basic directions ``[Press space to continue, 'q' to quit.]''. -The -d option also causes the message ``[Press 'h' for instructions.]'' to be -displayed when an invalid command is entered (normally, the bell is rung). -This option is useful in environments where users may not be experienced -with pagers. .\" .It Fl Dxcolor or --color=xcolor" .\" [MS-DOS only] .\" Sets the color of the text displayed. diff --git a/usr.bin/less/opttbl.c b/usr.bin/less/opttbl.c index f36c42e9a3a..9671d47196e 100644 --- a/usr.bin/less/opttbl.c +++ b/usr.bin/less/opttbl.c @@ -28,7 +28,6 @@ public int know_dumb; /* Don't complain about dumb terminals */ public int quit_at_eof; /* Quit after hitting end of file twice */ public int quit_if_one_screen; /* Quit if EOF on first screen */ public int squeeze; /* Squeeze multiple blank lines into one */ -public int be_helpful; /* more(1) style -d */ public int tabstop; /* Tab settings */ public int back_scroll; /* Repaint screen on backwards movement */ public int forw_scroll; /* Repaint screen on forward movement */ @@ -535,21 +534,6 @@ init_option() for (o = option; o->oletter != '\0'; o++) { - /* - * Replace less's -d option if invoked as more - */ - if (less_is_more && o->oletter == 'd') - { - o->onames = NULL; - o->otype = BOOL; - o->odefault = OPT_OFF; - o->ovar = &be_helpful; - o->ofunc = NULL; - o->odesc[0] = "Be less helpful in prompts"; - o->odesc[1] = "Be helpful in prompts"; - o->odesc[2] = NULL; - } - /* * Set each variable to its default. */