Merge "Display menu if no argument is given." into sc-dev
This commit is contained in:
@@ -123,7 +123,7 @@ using std::cerr;
|
|||||||
using std::endl;
|
using std::endl;
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
void usage() {
|
void exit_with_menu() {
|
||||||
cerr << "usage: metrics_dump [options] [<bugreport>]" << endl;
|
cerr << "usage: metrics_dump [options] [<bugreport>]" << endl;
|
||||||
cerr << endl;
|
cerr << endl;
|
||||||
cerr << "Displays the drm metrics that are generated by" << endl;
|
cerr << "Displays the drm metrics that are generated by" << endl;
|
||||||
@@ -146,7 +146,7 @@ void usage() {
|
|||||||
cerr << " --select <package>|<component>" << endl;
|
cerr << " --select <package>|<component>" << endl;
|
||||||
cerr << " only show metrics from the specified package or component"
|
cerr << " only show metrics from the specified package or component"
|
||||||
<< endl;
|
<< endl;
|
||||||
exit(-1);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
@@ -155,10 +155,11 @@ int main(int argc, char **argv) {
|
|||||||
GOOGLE_PROTOBUF_VERIFY_VERSION;
|
GOOGLE_PROTOBUF_VERIFY_VERSION;
|
||||||
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
|
if (argc == 1) exit_with_menu();
|
||||||
while (i < argc) {
|
while (i < argc) {
|
||||||
string arg = argv[i];
|
string arg = argv[i];
|
||||||
if (arg == "--help") {
|
if (arg == "--help") {
|
||||||
usage();
|
exit_with_menu();
|
||||||
} else if (arg == "--no-gms") {
|
} else if (arg == "--no-gms") {
|
||||||
metrics_dump::excluded_ones.push_back("com.google.android.gms");
|
metrics_dump::excluded_ones.push_back("com.google.android.gms");
|
||||||
} else if (arg == "--widevine") {
|
} else if (arg == "--widevine") {
|
||||||
@@ -184,7 +185,7 @@ int main(int argc, char **argv) {
|
|||||||
metrics_dump::selected_one = argv[++i];
|
metrics_dump::selected_one = argv[++i];
|
||||||
metrics_dump::to_lower(metrics_dump::selected_one);
|
metrics_dump::to_lower(metrics_dump::selected_one);
|
||||||
} else {
|
} else {
|
||||||
usage();
|
exit_with_menu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
|||||||
Reference in New Issue
Block a user