Add verbose flag -v and make -q the default behavior.

This commit is contained in:
joerg 2010-05-05 13:19:51 +00:00
parent 25ba15c805
commit aa73978631
2 changed files with 13 additions and 6 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: services_mkdb.8,v 1.10 2010/04/25 00:54:46 joerg Exp $
.\" $NetBSD: services_mkdb.8,v 1.11 2010/05/05 13:19:51 joerg Exp $
.\"
.\" Copyright (c) 1999 The NetBSD Foundation, Inc.
.\" All rights reserved.
@ -27,7 +27,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd March 19, 2010
.Dd May 5, 2010
.Dt SERVICES_MKDB 8
.Os
.Sh NAME
@ -35,7 +35,7 @@
.Nd generate the services databases
.Sh SYNOPSIS
.Nm
.Op Fl q
.Op Fl qv
.Op Fl o Ar database
.Op Fl V Ar style
.Op Ar file
@ -65,8 +65,11 @@ The options are as follows:
Put the output databases in the named file.
.It Fl q
Don't warn about duplicate services.
This is the default behavior.
.It Fl u
Print the services file to stdout, omitting duplicate entries and comments.
.It Fl v
Warn about duplicate services.
.It Fl V
Create a specific version of the database style.
.Ar style

View File

@ -1,4 +1,4 @@
/* $NetBSD: services_mkdb.c,v 1.15 2010/04/25 00:54:46 joerg Exp $ */
/* $NetBSD: services_mkdb.c,v 1.16 2010/05/05 13:19:51 joerg Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: services_mkdb.c,v 1.15 2010/04/25 00:54:46 joerg Exp $");
__RCSID("$NetBSD: services_mkdb.c,v 1.16 2010/05/05 13:19:51 joerg Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -70,7 +70,7 @@ main(int argc, char *argv[])
const char *fname = _PATH_SERVICES;
const char *dbname = NULL;
int use_db = 0;
int warndup = 1;
int warndup = 0;
int unique = 0;
int otherflag = 0;
size_t cnt = 0;
@ -94,6 +94,10 @@ main(int argc, char *argv[])
case 'u':
unique++;
break;
case 'v':
otherflag = 1;
warndup = 1;
break;
case 'V':
if (strcmp(optarg, "db") == 0)
use_db = 1;