tg_cli: improve verbosity parsing.

GitOrigin-RevId: b6f6ca9e6bf5e8908e257dd78c71630dfd3e2d0e
This commit is contained in:
levlam 2019-07-24 00:02:10 +03:00
parent 763a88233e
commit ae3c1208ea

View File

@ -3893,15 +3893,14 @@ void main(int argc, char **argv) {
if (*arg == '\0' && i + 1 < argc) {
arg = argv[++i];
}
int new_verbosity = 0;
if (arg[0] == 'v') {
new_verbosity = 1;
while (arg[0] == 'v') {
new_verbosity++;
arg++;
}
int new_verbosity = 1;
while (*arg == 'v') {
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;
} else if (!std::strncmp(argv[i], "-l", 2)) {
const char *arg = argv[i] + 2;