X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=options.c;h=32787e5a227f4b763a28fdb51e942c04fb5b9417;hp=179d892f4021239bda222ee4fdd84e9462e3c7b3;hb=3d24ca2da53f03585db396e67252a7dcd9e67e6e;hpb=62a64762ea3532d12853d431622b8cd05adbcc8c diff --git a/options.c b/options.c index 179d892..32787e5 100644 --- a/options.c +++ b/options.c @@ -40,6 +40,7 @@ gchar *opt_pd_binary = NULL; #endif gchar *opt_input_format = NULL; gchar *opt_output_format = NULL; +gchar *opt_transform_module = NULL; gchar *opt_show = NULL; gchar *opt_time = NULL; gchar *opt_samples = NULL; @@ -48,8 +49,10 @@ gchar *opt_continuous = NULL; gchar *opt_get = NULL; gchar *opt_set = NULL; -/* defines a callback function that generates - an error if an option occurs twice */ +/* + * Defines a callback function that generates an error if an + * option occurs twice. + */ #define CHECK_ONCE(option) \ static gboolean check_ ## option \ (const gchar *option_name, const gchar *value, \ @@ -73,6 +76,7 @@ CHECK_ONCE(opt_drv) CHECK_ONCE(opt_config) CHECK_ONCE(opt_input_format) CHECK_ONCE(opt_output_format) +CHECK_ONCE(opt_transform_module) CHECK_ONCE(opt_channels) CHECK_ONCE(opt_channel_group) CHECK_ONCE(opt_triggers) @@ -110,6 +114,8 @@ static const GOptionEntry optargs[] = { "Save output to file", NULL}, {"output-format", 'O', 0, G_OPTION_ARG_CALLBACK, &check_opt_output_format, "Output format", NULL}, + {"transform-module", 'T', 0, G_OPTION_ARG_CALLBACK, &check_opt_transform_module, + "Transform module", NULL}, {"channels", 'C', 0, G_OPTION_ARG_CALLBACK, &check_opt_channels, "Channels to use", NULL}, {"channel-group", 'g', 0, G_OPTION_ARG_CALLBACK, &check_opt_channel_group, @@ -147,8 +153,10 @@ static const GOptionEntry optargs[] = { {NULL, 0, 0, 0, NULL, NULL, NULL} }; -/* Parses the command line and sets all the 'opt_...' variables. - Returns zero on success, non-zero otherwise. */ +/* + * Parses the command line and sets all the 'opt_...' variables. + * Returns zero on success, non-zero otherwise. + */ int parse_options(int argc, char **argv) { GError *error = NULL;