Loading cmds/dumpstate/dumpstate.cpp +38 −33 Original line number Diff line number Diff line Loading @@ -1141,7 +1141,7 @@ static void dumpstate(const std::string& screenshot_path, const std::string& ver printf("========================================================\n"); } static void usage() { static void ShowUsageAndExit(int exitCode = 1) { fprintf(stderr, "usage: dumpstate [-h] [-b soundfile] [-e soundfile] [-o file [-d] [-p] " "[-z]] [-s] [-S] [-q] [-B] [-P] [-R] [-V version]\n" Loading @@ -1162,6 +1162,12 @@ static void usage() { "shouldn't be used with -P)\n" " -V: sets the bugreport format version (valid values: %s)\n", VERSION_DEFAULT.c_str()); exit(exitCode); } static void ExitOnInvalidArgs() { fprintf(stderr, "invalid combination of args\n"); ShowUsageAndExit(); } static void wake_lock_releaser() { Loading Loading @@ -1353,8 +1359,12 @@ int main(int argc, char *argv[]) { case 'R': is_remote_mode = 1; break; case 'B': do_broadcast = 1; break; case 'V': version = optarg; break; case '?': printf("\n"); case 'h': usage(); exit(1); case 'h': ShowUsageAndExit(0); break; default: fprintf(stderr, "Invalid option: %c\n", c); ShowUsageAndExit(); // clang-format on } } Loading Loading @@ -1382,28 +1392,23 @@ int main(int argc, char *argv[]) { } if ((do_zip_file || do_add_date || ds.updateProgress_ || do_broadcast) && !use_outfile) { usage(); exit(1); ExitOnInvalidArgs(); } if (use_control_socket && !do_zip_file) { usage(); exit(1); ExitOnInvalidArgs(); } if (ds.updateProgress_ && !do_broadcast) { usage(); exit(1); ExitOnInvalidArgs(); } if (is_remote_mode && (ds.updateProgress_ || !do_broadcast || !do_zip_file || !do_add_date)) { usage(); exit(1); ExitOnInvalidArgs(); } if (version != VERSION_DEFAULT) { usage(); exit(1); ShowUsageAndExit(); } MYLOGI("bugreport format version: %s\n", version.c_str()); Loading Loading
cmds/dumpstate/dumpstate.cpp +38 −33 Original line number Diff line number Diff line Loading @@ -1141,7 +1141,7 @@ static void dumpstate(const std::string& screenshot_path, const std::string& ver printf("========================================================\n"); } static void usage() { static void ShowUsageAndExit(int exitCode = 1) { fprintf(stderr, "usage: dumpstate [-h] [-b soundfile] [-e soundfile] [-o file [-d] [-p] " "[-z]] [-s] [-S] [-q] [-B] [-P] [-R] [-V version]\n" Loading @@ -1162,6 +1162,12 @@ static void usage() { "shouldn't be used with -P)\n" " -V: sets the bugreport format version (valid values: %s)\n", VERSION_DEFAULT.c_str()); exit(exitCode); } static void ExitOnInvalidArgs() { fprintf(stderr, "invalid combination of args\n"); ShowUsageAndExit(); } static void wake_lock_releaser() { Loading Loading @@ -1353,8 +1359,12 @@ int main(int argc, char *argv[]) { case 'R': is_remote_mode = 1; break; case 'B': do_broadcast = 1; break; case 'V': version = optarg; break; case '?': printf("\n"); case 'h': usage(); exit(1); case 'h': ShowUsageAndExit(0); break; default: fprintf(stderr, "Invalid option: %c\n", c); ShowUsageAndExit(); // clang-format on } } Loading Loading @@ -1382,28 +1392,23 @@ int main(int argc, char *argv[]) { } if ((do_zip_file || do_add_date || ds.updateProgress_ || do_broadcast) && !use_outfile) { usage(); exit(1); ExitOnInvalidArgs(); } if (use_control_socket && !do_zip_file) { usage(); exit(1); ExitOnInvalidArgs(); } if (ds.updateProgress_ && !do_broadcast) { usage(); exit(1); ExitOnInvalidArgs(); } if (is_remote_mode && (ds.updateProgress_ || !do_broadcast || !do_zip_file || !do_add_date)) { usage(); exit(1); ExitOnInvalidArgs(); } if (version != VERSION_DEFAULT) { usage(); exit(1); ShowUsageAndExit(); } MYLOGI("bugreport format version: %s\n", version.c_str()); Loading