diff options
author | José Bollo <jose.bollo@iot.bzh> | 2015-12-03 12:18:13 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2015-12-03 12:18:13 +0100 |
commit | e3c4a363ea7b03a909f9b92c6657ea9129ee53f3 (patch) | |
tree | b62976ff74cfb609f1a9bfabd04602e0211f59fb /wgtpkg-pack.c | |
parent | 38fbd847bcb58b9067ffe4bd56035ba4ccbf993b (diff) |
Adding verbosity
Change-Id: Icc0fdc6a230e2bf11fccc4f7739009e7266f6b9d
Diffstat (limited to 'wgtpkg-pack.c')
-rw-r--r-- | wgtpkg-pack.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/wgtpkg-pack.c b/wgtpkg-pack.c index 9164447..a8aaa05 100644 --- a/wgtpkg-pack.c +++ b/wgtpkg-pack.c @@ -47,6 +47,8 @@ static void usage() "\n" " -o wgtfile the output widget file\n" " -f force overwriting\n" + " -q quiet\n" + " -v verbose\n" "\n", appname ); @@ -56,6 +58,8 @@ static struct option options[] = { { "output", required_argument, NULL, 'o' }, { "force", no_argument, NULL, 'f' }, { "help", no_argument, NULL, 'h' }, + { "quiet", no_argument, NULL, 'q' }, + { "verbose", no_argument, NULL, 'v' }, { NULL, 0, NULL, 0 } }; @@ -71,13 +75,20 @@ int main(int ac, char **av) force = 0; wgtfile = directory = NULL; for (;;) { - i = getopt_long(ac, av, "hfo:", options, NULL); + i = getopt_long(ac, av, "qvhfo:", options, NULL); if (i < 0) break; switch (i) { case 'o': wgtfile = optarg; break; + case 'q': + if (verbosity) + verbosity--; + break; + case 'v': + verbosity++; + break; case 'f': force = 1; break; @@ -124,7 +135,7 @@ int main(int ac, char **av) return 1; } -printf("\n\nPACKING widget %s from directory %s\n", wgtfile, directory); + notice("-- PACKING widget %s from directory %s", wgtfile, directory); /* creates an existing widget (for realpath it must exist) */ i = open(wgtfile, O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666); |