Sync usage between program and man page. Increase column width. [1]

Simplifay the usage() function
Replace errx/strerror with errc

Submitted by:	wiz@NetBSD.org [1]
Obtained from:	NetBSD
This commit is contained in:
Baptiste Daroussin 2016-07-08 23:40:25 +00:00
parent 356c50adff
commit aa0bf3d606
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=302473
2 changed files with 11 additions and 13 deletions

View File

@ -34,7 +34,7 @@
.\" .\"
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd September 6, 2009 .Dd July 9, 2016
.Dt MKCSMAPPER 1 .Dt MKCSMAPPER 1
.Os .Os
.Sh NAME .Sh NAME
@ -43,9 +43,10 @@
.Xr iconv 3 .Xr iconv 3
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl dmp .Op Fl d
.Fl o Ar outfile .Op Fl m | Fl p
.Ar infile .Op Fl o Ar outfile
.Op Ar infile
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Nm .Nm
@ -59,7 +60,7 @@ A pivot file, which the possible source and destination encoding
pairs or the set of mappings to use for a compound encoding. pairs or the set of mappings to use for a compound encoding.
.Pp .Pp
The following options are available: The following options are available:
.Bl -tag -width 0123 .Bl -tag -width XoXoutfileXX
.It Fl d .It Fl d
Turns on debug mode. Turns on debug mode.
.It Fl m .It Fl m

View File

@ -1,5 +1,5 @@
/* $FreeBSD$ */ /* $FreeBSD$ */
/* $NetBSD: yacc.y,v 1.7 2006/09/09 14:35:17 tnozaki Exp $ */ /* $NetBSD: yacc.y,v 1.11 2016/06/28 09:22:16 wiz Exp $ */
%{ %{
/*- /*-
@ -664,18 +664,15 @@ do_mkpv(FILE *in)
if (ret && output) if (ret && output)
unlink(output); /* dump failure */ unlink(output); /* dump failure */
if (ret) if (ret)
errx(EXIT_FAILURE, "%s\n", strerror(ret)); errc(EXIT_FAILURE, ret, "");
} }
static void static void
usage(void) usage(void)
{ {
warnx("usage: \n" fprintf(stderr, "Usage: %s [-d] [-m|-p] [-o outfile] [infile]\n",
"\t%s [-d] [-o outfile] [infile]\n" getprogname());
"\t%s -m [-d] [-o outfile] [infile]\n" exit(EXIT_FAILURE);
"\t%s -p [-d] [-o outfile] [infile]\n",
getprogname(), getprogname(), getprogname());
exit(1);
} }
int int