Make msgfile optional like other OS's

This commit is contained in:
christos 2011-12-29 16:41:38 +00:00
parent 8e707c4932
commit 6e1ec48784
2 changed files with 9 additions and 10 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: gencat.1,v 1.12 2009/03/09 19:24:32 joerg Exp $ .\" $NetBSD: gencat.1,v 1.13 2011/12/29 16:41:38 christos Exp $
.\" .\"
.\" Copyright (c) 2007 The NetBSD Foundation, Inc. .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
.\" All rights reserved. .\" All rights reserved.
@ -29,7 +29,7 @@
.\" .\"
.\" Written by Kee Hinckley <nazgul@somewhere.com> .\" Written by Kee Hinckley <nazgul@somewhere.com>
.\" .\"
.Dd November 4, 2008 .Dd December 29, 2011
.Dt GENCAT 1 .Dt GENCAT 1
.Os .Os
.Sh NAME .Sh NAME
@ -38,14 +38,13 @@
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Ar catfile .Ar catfile
.Ar msgfile .Op Ar msgfile|- ...
.Op Ar msgfile ...
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Nm .Nm
utility generates a formatted message catalog utility generates a formatted message catalog
.Ar catfile .Ar catfile
from one or more message source text files from stdin or one or more message source text files
.Ar msgfile . .Ar msgfile .
The file The file
.Ar catfile .Ar catfile

View File

@ -1,4 +1,4 @@
/* $NetBSD: gencat.c,v 1.32 2011/09/21 14:33:35 christos Exp $ */ /* $NetBSD: gencat.c,v 1.33 2011/12/29 16:41:38 christos Exp $ */
/* /*
* Copyright (c) 1996 The NetBSD Foundation, Inc. * Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint) #if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: gencat.c,v 1.32 2011/09/21 14:33:35 christos Exp $"); __RCSID("$NetBSD: gencat.c,v 1.33 2011/12/29 16:41:38 christos Exp $");
#endif #endif
/*********************************************************** /***********************************************************
@ -163,7 +163,7 @@ main(int argc, char *argv[])
argc -= optind; argc -= optind;
argv += optind; argv += optind;
if (argc < 2) { if (argc < 1) {
usage(); usage();
/* NOTREACHED */ /* NOTREACHED */
} }
@ -193,8 +193,8 @@ main(int argc, char *argv[])
} }
} }
if (((*argv)[0] == '-') && ((*argv)[1] == '\0')) { if (argc < 2 || (((*argv)[0] == '-') && ((*argv)[1] == '\0'))) {
if (argc != 2) if (argc > 2)
usage(); usage();
/* NOTREACHED */ /* NOTREACHED */
MCParse(STDIN_FILENO); MCParse(STDIN_FILENO);