Localize it
This commit is contained in:
parent
8b0f80aa08
commit
5ff251c82d
@ -50,7 +50,7 @@
|
|||||||
.Bk -words
|
.Bk -words
|
||||||
.Op Fl Ar column
|
.Op Fl Ar column
|
||||||
.Ek
|
.Ek
|
||||||
.Op Fl adFmrt
|
.Op Fl adFLmrt
|
||||||
.Bk -words
|
.Bk -words
|
||||||
.Oo
|
.Oo
|
||||||
.Op Fl e
|
.Op Fl e
|
||||||
@ -218,6 +218,8 @@ If any nondigit character,
|
|||||||
is specified, it is used as the output
|
is specified, it is used as the output
|
||||||
.Em <tab>
|
.Em <tab>
|
||||||
character.
|
character.
|
||||||
|
.It Fl L
|
||||||
|
Do not use time locale for header.
|
||||||
.It Fl l Ar lines
|
.It Fl l Ar lines
|
||||||
Override the 66 line default and reset the page length to
|
Override the 66 line default and reset the page length to
|
||||||
.Ar lines .
|
.Ar lines .
|
||||||
|
@ -33,6 +33,8 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@ -51,6 +53,7 @@ static char sccsid[] = "@(#)pr.c 8.2 (Berkeley) 4/16/94";
|
|||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <locale.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -1557,7 +1560,7 @@ void
|
|||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
(void)fputs(
|
(void)fputs(
|
||||||
"usage: pr [+page] [-col] [-adFmrt] [-e[ch][gap]] [-h header]\n",err);
|
"usage: pr [+page] [-col] [-adFLmrt] [-e[ch][gap]] [-h header]\n",err);
|
||||||
(void)fputs(
|
(void)fputs(
|
||||||
" [-i[ch][gap]] [-l line] [-n[ch][width]] [-o offset]\n",err);
|
" [-i[ch][gap]] [-l line] [-n[ch][width]] [-o offset]\n",err);
|
||||||
(void)fputs(
|
(void)fputs(
|
||||||
@ -1578,6 +1581,7 @@ setup(argc, argv)
|
|||||||
int iflag = 0;
|
int iflag = 0;
|
||||||
int wflag = 0;
|
int wflag = 0;
|
||||||
int cflag = 0;
|
int cflag = 0;
|
||||||
|
int Lflag = 0;
|
||||||
|
|
||||||
if (isatty(fileno(stdout))) {
|
if (isatty(fileno(stdout))) {
|
||||||
/*
|
/*
|
||||||
@ -1589,7 +1593,7 @@ setup(argc, argv)
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
err = stderr;
|
err = stderr;
|
||||||
while ((c = egetopt(argc, argv, "#adFmrte?h:i?l:n?o:s?w:")) != -1) {
|
while ((c = egetopt(argc, argv, "#adFmrte?h:i?Ll:n?o:s?w:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case '+':
|
case '+':
|
||||||
if ((pgnm = atoi(eoptarg)) < 1) {
|
if ((pgnm = atoi(eoptarg)) < 1) {
|
||||||
@ -1614,11 +1618,11 @@ setup(argc, argv)
|
|||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
++eflag;
|
++eflag;
|
||||||
if ((eoptarg != NULL) && !isdigit(*eoptarg))
|
if ((eoptarg != NULL) && !isdigit((unsigned char)*eoptarg))
|
||||||
inchar = *eoptarg++;
|
inchar = *eoptarg++;
|
||||||
else
|
else
|
||||||
inchar = INCHAR;
|
inchar = INCHAR;
|
||||||
if ((eoptarg != NULL) && isdigit(*eoptarg)) {
|
if ((eoptarg != NULL) && isdigit((unsigned char)*eoptarg)) {
|
||||||
if ((ingap = atoi(eoptarg)) < 0) {
|
if ((ingap = atoi(eoptarg)) < 0) {
|
||||||
(void)fputs(
|
(void)fputs(
|
||||||
"pr: -e gap must be 0 or more\n", err);
|
"pr: -e gap must be 0 or more\n", err);
|
||||||
@ -1641,11 +1645,11 @@ setup(argc, argv)
|
|||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
++iflag;
|
++iflag;
|
||||||
if ((eoptarg != NULL) && !isdigit(*eoptarg))
|
if ((eoptarg != NULL) && !isdigit((unsigned char)*eoptarg))
|
||||||
ochar = *eoptarg++;
|
ochar = *eoptarg++;
|
||||||
else
|
else
|
||||||
ochar = OCHAR;
|
ochar = OCHAR;
|
||||||
if ((eoptarg != NULL) && isdigit(*eoptarg)) {
|
if ((eoptarg != NULL) && isdigit((unsigned char)*eoptarg)) {
|
||||||
if ((ogap = atoi(eoptarg)) < 0) {
|
if ((ogap = atoi(eoptarg)) < 0) {
|
||||||
(void)fputs(
|
(void)fputs(
|
||||||
"pr: -i gap must be 0 or more\n", err);
|
"pr: -i gap must be 0 or more\n", err);
|
||||||
@ -1660,8 +1664,11 @@ setup(argc, argv)
|
|||||||
} else
|
} else
|
||||||
ogap = OGAP;
|
ogap = OGAP;
|
||||||
break;
|
break;
|
||||||
|
case 'L':
|
||||||
|
Lflag++;
|
||||||
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
if (!isdigit(*eoptarg) || ((lines=atoi(eoptarg)) < 1)) {
|
if (!isdigit((unsigned char)*eoptarg) || ((lines=atoi(eoptarg)) < 1)) {
|
||||||
(void)fputs(
|
(void)fputs(
|
||||||
"pr: Number of lines must be 1 or more\n",err);
|
"pr: Number of lines must be 1 or more\n",err);
|
||||||
return(1);
|
return(1);
|
||||||
@ -1671,11 +1678,11 @@ setup(argc, argv)
|
|||||||
++merge;
|
++merge;
|
||||||
break;
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
if ((eoptarg != NULL) && !isdigit(*eoptarg))
|
if ((eoptarg != NULL) && !isdigit((unsigned char)*eoptarg))
|
||||||
nmchar = *eoptarg++;
|
nmchar = *eoptarg++;
|
||||||
else
|
else
|
||||||
nmchar = NMCHAR;
|
nmchar = NMCHAR;
|
||||||
if ((eoptarg != NULL) && isdigit(*eoptarg)) {
|
if ((eoptarg != NULL) && isdigit((unsigned char)*eoptarg)) {
|
||||||
if ((nmwd = atoi(eoptarg)) < 1) {
|
if ((nmwd = atoi(eoptarg)) < 1) {
|
||||||
(void)fputs(
|
(void)fputs(
|
||||||
"pr: -n width must be 1 or more\n",err);
|
"pr: -n width must be 1 or more\n",err);
|
||||||
@ -1689,7 +1696,7 @@ setup(argc, argv)
|
|||||||
nmwd = NMWD;
|
nmwd = NMWD;
|
||||||
break;
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
if (!isdigit(*eoptarg) || ((offst = atoi(eoptarg))< 1)){
|
if (!isdigit((unsigned char)*eoptarg) || ((offst = atoi(eoptarg))< 1)){
|
||||||
(void)fputs("pr: -o offset must be 1 or more\n",
|
(void)fputs("pr: -o offset must be 1 or more\n",
|
||||||
err);
|
err);
|
||||||
return(1);
|
return(1);
|
||||||
@ -1715,7 +1722,7 @@ setup(argc, argv)
|
|||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
++wflag;
|
++wflag;
|
||||||
if (!isdigit(*eoptarg) || ((pgwd = atoi(eoptarg)) < 1)){
|
if (!isdigit((unsigned char)*eoptarg) || ((pgwd = atoi(eoptarg)) < 1)){
|
||||||
(void)fputs(
|
(void)fputs(
|
||||||
"pr: -w width must be 1 or more \n",err);
|
"pr: -w width must be 1 or more \n",err);
|
||||||
return(1);
|
return(1);
|
||||||
@ -1810,5 +1817,8 @@ setup(argc, argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
timefrmt = TIMEFMT;
|
timefrmt = TIMEFMT;
|
||||||
|
if (!Lflag)
|
||||||
|
(void) setlocale(LC_TIME, "");
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)pr.h 8.1 (Berkeley) 6/6/93
|
* @(#)pr.h 8.1 (Berkeley) 6/6/93
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -58,7 +59,7 @@
|
|||||||
#define HDFMT "%s %s Page %d\n\n\n"
|
#define HDFMT "%s %s Page %d\n\n\n"
|
||||||
#define HEADLEN 5
|
#define HEADLEN 5
|
||||||
#define TAILLEN 5
|
#define TAILLEN 5
|
||||||
#define TIMEFMT "%b %e %H:%M %Y"
|
#define TIMEFMT "%Ex %H:%M %Y"
|
||||||
#define FNAME ""
|
#define FNAME ""
|
||||||
#define LBUF 8192
|
#define LBUF 8192
|
||||||
#define HDBUF 512
|
#define HDBUF 512
|
||||||
|
Loading…
Reference in New Issue
Block a user