From fece31a026884dda16c9733077ccf885fd7671b3 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Fri, 29 Apr 2011 23:04:58 +0300 Subject: [PATCH] options: Make verbose level adjustable Signed-off-by: Timo Kokkonen --- options.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/options.c b/options.c index 4e2a539..90fb448 100644 --- a/options.c +++ b/options.c @@ -1,5 +1,6 @@ #include #include +#include #include "options.h" @@ -8,7 +9,7 @@ int read_args(int argc, char *argv[], struct user_options *opts) int option_index = 0, c; static struct option long_options[] = { { .val = 'd', .name = "device", .has_arg = 1, }, - { .val = 'v', .name = "verbose", }, + { .val = 'v', .name = "verbose", .has_arg = 2}, }; char short_options[] = "d:v"; @@ -26,7 +27,10 @@ int read_args(int argc, char *argv[], struct user_options *opts) opts->usbdev = optarg; break; case 'v': - opts->trace_level++; + if (optarg) + opts->trace_level = atoi(optarg); + else + opts->trace_level++; case '?': return -1; } -- 2.45.0