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