case 'o':
conf.checkduplicate = true;
break;
+ case 'q':
+ conf.quiet = true;
+ break;
default:
addarg(&arglist, ch, optarg);
break;
* We should immediately look for the -q 'quiet' switch so that we
* don't bother with extraneous errors
*/
- if (getarg(&arglist, 'q') != NULL)
+ if (conf.quiet)
freopen(_PATH_DEVNULL, "w", stderr);
/*
};
if (mode == M_NEXT)
- return (pw_groupnext(cnf, getarg(args, 'q') != NULL));
+ return (pw_groupnext(cnf, conf.quiet));
if (mode == M_LOCK || mode == M_UNLOCK)
errx(EX_USAGE, "'lock' command is not available for groups");
cnf = conf.userconf;
if (mode == M_NEXT)
- return (pw_usernext(cnf, getarg(args, 'q') != NULL));
+ return (pw_usernext(cnf, conf.quiet));
/*
* We can do all of the common legwork here
char *config;
int fd;
int which;
+ bool quiet;
bool dryrun;
bool pretty;
bool v7;