Loading cmds/dumpsys/dumpsys.cpp +21 −4 Original line number Diff line number Diff line Loading @@ -26,6 +26,17 @@ static int sort_func(const String16* lhs, const String16* rhs) return lhs->compare(*rhs); } static void usage() { fprintf(stderr, "usage: dumpsys\n" " To dump all services.\n" "or:\n" " dumpsys [--help | -l | SERVICE [ARGS]]\n" " --help: shows this help\n" " -l: only list services, do not dump them\n" " SERVICE: dumps only service SERVICE, optionally passing ARGS to it\n"); } int main(int argc, char* const argv[]) { signal(SIGPIPE, SIG_IGN); Loading @@ -40,9 +51,15 @@ int main(int argc, char* const argv[]) Vector<String16> services; Vector<String16> args; bool showListOnly = false; if ((argc == 2) && (strcmp(argv[1], "-l") == 0)) { if (argc == 2) { if (strcmp(argv[1], "--help") == 0) { usage(); return 0; } if (strcmp(argv[1], "-l") == 0) { showListOnly = true; } } if ((argc == 1) || showListOnly) { services = sm->listServices(); services.sort(sort_func); Loading Loading
cmds/dumpsys/dumpsys.cpp +21 −4 Original line number Diff line number Diff line Loading @@ -26,6 +26,17 @@ static int sort_func(const String16* lhs, const String16* rhs) return lhs->compare(*rhs); } static void usage() { fprintf(stderr, "usage: dumpsys\n" " To dump all services.\n" "or:\n" " dumpsys [--help | -l | SERVICE [ARGS]]\n" " --help: shows this help\n" " -l: only list services, do not dump them\n" " SERVICE: dumps only service SERVICE, optionally passing ARGS to it\n"); } int main(int argc, char* const argv[]) { signal(SIGPIPE, SIG_IGN); Loading @@ -40,9 +51,15 @@ int main(int argc, char* const argv[]) Vector<String16> services; Vector<String16> args; bool showListOnly = false; if ((argc == 2) && (strcmp(argv[1], "-l") == 0)) { if (argc == 2) { if (strcmp(argv[1], "--help") == 0) { usage(); return 0; } if (strcmp(argv[1], "-l") == 0) { showListOnly = true; } } if ((argc == 1) || showListOnly) { services = sm->listServices(); services.sort(sort_func); Loading