From 2a41502cde51f736b37791bd78fe97f0cf8c3d05 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Mon, 17 Aug 2015 02:36:31 +1000 Subject: [PATCH] test-record: Check parameter count and print out help If no launch pipeline was supplied, print out some help --- examples/test-record.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/test-record.c b/examples/test-record.c index 1c6ac3f..1c37503 100644 --- a/examples/test-record.c +++ b/examples/test-record.c @@ -51,6 +51,11 @@ main (int argc, char *argv[]) g_printerr ("Error parsing options: %s\n", error->message); return -1; } + + if (argc < 2) { + g_print ("%s\n", g_option_context_get_help (optctx, TRUE, NULL)); + return 1; + } g_option_context_free (optctx); loop = g_main_loop_new (NULL, FALSE); -- 2.7.4