tg_cli: improve verbosity parsing.
GitOrigin-RevId: b6f6ca9e6bf5e8908e257dd78c71630dfd3e2d0e
This commit is contained in:
parent
763a88233e
commit
ae3c1208ea
@ -3893,15 +3893,14 @@ void main(int argc, char **argv) {
|
|||||||
if (*arg == '\0' && i + 1 < argc) {
|
if (*arg == '\0' && i + 1 < argc) {
|
||||||
arg = argv[++i];
|
arg = argv[++i];
|
||||||
}
|
}
|
||||||
int new_verbosity = 0;
|
int new_verbosity = 1;
|
||||||
if (arg[0] == 'v') {
|
while (*arg == 'v') {
|
||||||
new_verbosity = 1;
|
new_verbosity++;
|
||||||
while (arg[0] == 'v') {
|
arg++;
|
||||||
new_verbosity++;
|
}
|
||||||
arg++;
|
if (*arg) {
|
||||||
}
|
new_verbosity += to_integer<int>(Slice(arg)) - (new_verbosity == 1);
|
||||||
}
|
}
|
||||||
new_verbosity += to_integer<int>(Slice(arg));
|
|
||||||
new_verbosity_level = VERBOSITY_NAME(FATAL) + new_verbosity;
|
new_verbosity_level = VERBOSITY_NAME(FATAL) + new_verbosity;
|
||||||
} else if (!std::strncmp(argv[i], "-l", 2)) {
|
} else if (!std::strncmp(argv[i], "-l", 2)) {
|
||||||
const char *arg = argv[i] + 2;
|
const char *arg = argv[i] + 2;
|
||||||
|
Reference in New Issue
Block a user