X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=options.c;h=179d892f4021239bda222ee4fdd84e9462e3c7b3;hp=03c001cd2df25d486d6f69f5690dfdc73ab5688a;hb=5e78186bb0d97e1ce995990c1167c41537ab34dc;hpb=44ac76145c74a503916ffc9a29701b3226d8c0c6 diff --git a/options.c b/options.c index 03c001c..179d892 100644 --- a/options.c +++ b/options.c @@ -45,6 +45,7 @@ gchar *opt_time = NULL; gchar *opt_samples = NULL; gchar *opt_frames = NULL; gchar *opt_continuous = NULL; +gchar *opt_get = NULL; gchar *opt_set = NULL; /* defines a callback function that generates @@ -85,6 +86,7 @@ CHECK_ONCE(opt_pd_binary) CHECK_ONCE(opt_time) CHECK_ONCE(opt_samples) CHECK_ONCE(opt_frames) +CHECK_ONCE(opt_get) #undef CHECK_STR_ONCE @@ -140,6 +142,7 @@ static const GOptionEntry optargs[] = { "Number of frames to acquire", NULL}, {"continuous", 0, 0, G_OPTION_ARG_NONE, &opt_continuous, "Sample continuously", NULL}, + {"get", 0, 0, G_OPTION_ARG_CALLBACK, &check_opt_get, "Get device option only", NULL}, {"set", 0, 0, G_OPTION_ARG_NONE, &opt_set, "Set device options only", NULL}, {NULL, 0, 0, 0, NULL, NULL, NULL} }; @@ -181,6 +184,11 @@ int parse_options(int argc, char **argv) opt_output_file = g_strdup(output_file_array[0]); } + if (1 != argc) { + g_critical("superfluous command line argument \"%s\"", argv[1]); + goto done; + } + ret = 0; done: