9 static void set_default_options(struct plotter_options *opts)
11 bzero(opts, sizeof(*opts));
13 opts->baud_rate = 128000;
14 opts->device_path = "/dev/ttyUSB0";
17 int read_args(int argc, char *argv[], struct plotter_options *opts)
19 int option_index = 0, c;
20 static struct option long_options[] = {
21 { .val = 'd', .name = "device", .has_arg = 1, },
22 { .val = 'o', .name = "output", .has_arg = 1 },
23 { .val = 'b', .name = "baud", .has_arg = 1 },
24 { .val = 'v', .name = "verbose", .has_arg = 2 },
25 { .val = 'q', .name = "quiet", },
27 char short_options[] = "d:o:b:vq";
29 set_default_options(opts);
32 c = getopt_long(argc, argv, short_options, long_options,
40 opts->device_path = optarg;
43 opts->output_path = optarg;
46 opts->baud_rate = atoi(optarg);
50 pr_debug("Increased trace level to %d\n", trace_level);
54 pr_debug("Degreased trace level to %d\n", trace_level);
61 while (optind < argc) {
62 /* The rest of the options, ignored */