diff options
author | Christian Pointner <equinox@spreadspace.org> | 2014-10-08 03:20:30 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2014-10-08 03:20:30 +0200 |
commit | 8fe89832159647cd165cf7de282eb713bf01bc0f (patch) | |
tree | 4c799d521bd4ab6774237891a60dc08db408ed05 /src/options-launch.c | |
parent | add manpage for sydra-launch (diff) |
complain about unkown command line arguments
Diffstat (limited to 'src/options-launch.c')
-rw-r--r-- | src/options-launch.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/options-launch.c b/src/options-launch.c index fad40fe..16e855d 100644 --- a/src/options-launch.c +++ b/src/options-launch.c @@ -61,6 +61,21 @@ static void options_defaults(options_t* opt) opt->pipeline_ = NULL; } +static GQuark options_error_quark() +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string("sydra_options_error"); + + return quark; +} + +static gboolean options_parse_remaining(const gchar *option_name, const gchar *value, gpointer data, GError **error) +{ + g_set_error(error, options_error_quark(), G_OPTION_ERROR_FAILED, "unkown option '%s'", value); + return FALSE; +} + static int options_parse_post(options_t* opt); int options_parse(options_t* opt, int argc, char* argv[]) @@ -97,6 +112,7 @@ int options_parse(options_t* opt, int argc, char* argv[]) "set the application name (will be used by xvimagesink for window title)", "NAME" }, { "pipeline", 'p', 0, G_OPTION_ARG_STRING, &opt->pipeline_, "the gst-launch style pipeline description", "PIPELINE DESCRIPTION" }, + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_CALLBACK, options_parse_remaining, NULL, NULL}, { NULL } }; GOptionContext *ctx = g_option_context_new("- spreadspace streaming hydra "); |