Commit 5aa409af authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

crtools: handle -vv..vv propertly

-vv...v must increase logging level on a number of the 'v' symbols.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9a2219af
......@@ -171,9 +171,13 @@ int main(int argc, char *argv[])
return -1;
break;
case 'v':
if (optarg)
log_level = atoi(optarg);
if (optarg) {
if (optarg[0] == 'v')
/* handle -vvvvv */
log_level += strlen(optarg) + 1;
else
log_level = atoi(optarg);
} else
log_level++;
break;
case 41:
......@@ -392,7 +396,7 @@ usage:
"* Logging:\n"
" -o|--log-file FILE log file name (path is relative to --images-dir)\n"
" --log-pid enable per-process logging to separate FILE.pid files\n"
" -v [NUM] set logging level:\n"
" -v[NUM] set logging level:\n"
" -v0 - messages regardless of log level\n"
" -v1, -v - errors, when we are in trouble\n"
" -v2, -vv - warnings (default)\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment