+ int c;
+
+ while (1) {
+ static struct option options[] = {
+ {"list", no_argument, 0, 'l'},
+ {"filter", required_argument, 0, 'f'},
+ {"verbose", no_argument, 0, 'v'},
+ {"shuffle", no_argument, 0, 's'},
+ {"repeat", required_argument, 0, 'r'},
+ {"output", required_argument, 0, 'o'},
+
+ /* For manual test*/
+ {"interval", required_argument, 0, 'i'},
+ {"batch_latency", required_argument, 0, 'b'},
+ {"powersave", required_argument, 0, 'p'},
+
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+
+ int option_index = 0;
+ c = getopt_long(argc, argv, "lfvsroibph:", options, &option_index);
+ if (c == -1)
+ return true;
+
+ switch (c) {
+ case 0:
+ break;
+ case 'l':
+ _I("== Testcase List ==\n");
+ test_bench::show_testcases();
+ test_option::show_list = true;
+ break;
+ case 'f':
+ _I("Filter : %s\n", optarg);
+ if (!optarg) break;
+ test_option::filter = optarg;
+ break;
+ case 'v':
+ _I("Verbose is on\n");
+ test_option::verbose = true;
+ break;
+ case 's':
+ _I("Shuffle is on(Default seed)\n");
+ test_option::shuffle = true;
+ break;
+ case 'r':
+ _I("Repeat : %s\n", optarg);
+ if (!optarg) break;
+ test_option::repeat = atoi(optarg);
+ break;
+ case 'o':
+ /* [TODO] */
+ _W("File output is not supported yet, use $sensorctl > out : %s\n", optarg);
+ if (!optarg) break;
+ test_option::output = optarg;
+ break;
+ case 'i':
+ _I("Interval : %s\n", optarg);
+ if (!optarg) break;
+ test_option::interval = atoi(optarg);
+ break;
+ case 'b':
+ _I("Batch latency : %s\n", optarg);
+ if (!optarg) break;
+ test_option::latency = atoi(optarg);
+ break;
+ case 'p':
+ _I("Power save : %s\n", optarg);
+ if (!optarg) break;
+ test_option::powersave = atoi(optarg);
+ break;
+ case 'h':
+ case '?':
+ default:
+ return false;
+ }
+ }