2 * Copyright (C) 2012 Timo Kokkonen <timo.t.kokkonen@iki.fi>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 int read_args(int argc, char *argv[], struct user_options *opts)
28 int option_index = 0, c;
29 static struct option long_options[] = {
30 { .val = 'd', .name = "device", .has_arg = 1, },
31 { .val = 'v', .name = "verbose", .has_arg = 2 },
32 { .val = 'o', .name = "output", .has_arg = 1 },
34 char short_options[] = "d:v:o:";
36 memset(opts, 0, sizeof(*opts));
39 c = getopt_long(argc, argv, short_options, long_options,
47 opts->usbdev = optarg;
51 opts->trace_level = atoi(optarg);
55 opts->output_path = optarg;
62 while (optind < argc) {
64 * Some day we do something useful here with the rest
65 * of the options.. Maybe