]> sigrok.org Git - sigrok-cli.git/commitdiff
options: expand builtin help, discuss samples/time/continuous constraint
authorGerhard Sittig <redacted>
Tue, 23 May 2017 17:41:41 +0000 (19:41 +0200)
committerUwe Hermann <redacted>
Tue, 23 May 2017 18:05:34 +0000 (20:05 +0200)
It might be surprising when the sigrok-cli(1) program does nothing (yet
spends user noticable time) before quitting while it spews the --help
text to the screen. Expand the builtin help text, explicitly mention
that either of --samples or --frames or --time or --continuous are
essentially required for data acquisition.

options.c

index 4d398471ee86f22012a1a65994239f3ae79fe836..9c8dc8cd04fa6fd674d9ca1460e6eefcf2e119a2 100644 (file)
--- a/options.c
+++ b/options.c
@@ -215,4 +215,16 @@ void show_help(void)
        g_free(help);
 
        g_option_context_free(context);
+
+#ifdef HAVE_SRD
+#define SHOW_DECODER_TEXT "| -P <decoder> "
+#else
+#define SHOW_DECODER_TEXT ""
+#endif
+       printf("Example use, typical options:\n");
+       printf("  -d <driver> --scan\n");
+       printf("  -d <driver> { --samples N | --frames N | --time T | --continuous }\n");
+       printf("  { -d <driver> | -I <format> | -O <format> %s} --show\n", SHOW_DECODER_TEXT);
+       printf("  See the manpage or the wiki for more details.\n");
+       printf("  Note: --samples/--frames/--time/--continuous is required for acquisition.\n");
 }