From 61485a50fb8b4a5d9adcc7b71c2a6df7109f76b8 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sat, 11 Jul 2015 17:01:08 +0000 Subject: Move the quiet flag into the configuration structure --- pw/pw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pw/pw.c') diff --git a/pw/pw.c b/pw/pw.c index 6769738..951abc6 100644 --- a/pw/pw.c +++ b/pw/pw.c @@ -314,6 +314,9 @@ main(int argc, char *argv[]) case 'o': conf.checkduplicate = true; break; + case 'q': + conf.quiet = true; + break; default: addarg(&arglist, ch, optarg); break; @@ -334,7 +337,7 @@ main(int argc, char *argv[]) * 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); /* -- cgit v1.2.3-56-ge451