From 6bb6d94196a5509b8054bd3fa893cdd6f389c639 Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 30 Nov 1999 15:09:26 +0000 Subject: Change meaning of newly introduced -L option - it helps lpr later --- usr.bin/pr/pr.1 | 12 +++++++++--- usr.bin/pr/pr.c | 13 ++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/pr/pr.1 b/usr.bin/pr/pr.1 index bbe41f5..85d011c 100644 --- a/usr.bin/pr/pr.1 +++ b/usr.bin/pr/pr.1 @@ -50,7 +50,7 @@ .Bk -words .Op Fl Ar column .Ek -.Op Fl adFLmrt +.Op Fl adFmrt .Bk -words .Oo .Op Fl e @@ -59,6 +59,9 @@ .Oc .Ek .Bk -words +.Op Fl L Ar locale +.Ek +.Bk -words .Op Fl h Ar header .Ek .Bk -words @@ -218,8 +221,11 @@ If any nondigit character, is specified, it is used as the output .Em character. -.It Fl L -Do not use time locale for header. +.It Fl L Ar locale +Use +.Ar locale +specified as argument instead of one found in environment. +Use "C" to reset locale to default. .It Fl l Ar lines Override the 66 line default and reset the page length to .Ar lines . diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c index aaaf389..d01728a 100644 --- a/usr.bin/pr/pr.c +++ b/usr.bin/pr/pr.c @@ -1560,11 +1560,11 @@ void usage() { (void)fputs( - "usage: pr [+page] [-col] [-adFLmrt] [-e[ch][gap]] [-h header]\n",err); + "usage: pr [+page] [-col] [-adFmrt] [-e[ch][gap]] [-h header]\n",err); (void)fputs( " [-i[ch][gap]] [-l line] [-n[ch][width]] [-o offset]\n",err); (void)fputs( - " [-s[ch]] [-w width] [-] [file ...]\n", err); + " [-L locale] [-s[ch]] [-w width] [-] [file ...]\n", err); } /* @@ -1581,7 +1581,7 @@ setup(argc, argv) int iflag = 0; int wflag = 0; int cflag = 0; - int Lflag = 0; + char *Lflag = NULL; if (isatty(fileno(stdout))) { /* @@ -1593,7 +1593,7 @@ setup(argc, argv) } } else err = stderr; - while ((c = egetopt(argc, argv, "#adFmrte?h:i?Ll:n?o:s?w:")) != -1) { + while ((c = egetopt(argc, argv, "#adFmrte?h:i?L:l:n?o:s?w:")) != -1) { switch (c) { case '+': if ((pgnm = atoi(eoptarg)) < 1) { @@ -1665,7 +1665,7 @@ setup(argc, argv) ogap = OGAP; break; case 'L': - Lflag++; + Lflag = eoptarg; break; case 'l': if (!isdigit((unsigned char)*eoptarg) || ((lines=atoi(eoptarg)) < 1)) { @@ -1817,8 +1817,7 @@ setup(argc, argv) } timefrmt = TIMEFMT; - if (!Lflag) - (void) setlocale(LC_TIME, ""); + (void) setlocale(LC_TIME, (Lflag != NULL) ? Lflag : ""); return(0); } -- cgit v1.1