Move this data from -V to -L|--list-supported for usability reasons.
This fixes bug #604.
.B "\-V, \-\-version"
Show
.B sigrok-cli
-version, and information about supported hardware drivers, input file
+version and the versions of libraries used.
+.TP
+.B "\-L, \-\-list-supported"
+Show information about supported hardware drivers, input file
formats, output file formats, and protocol decoders.
.TP
\fB\-d, \-\-driver\fP <drivername>
if (opt_version)
show_version();
+ else if (opt_list_supported)
+ show_supported();
else if (opt_input_format && opt_show)
show_input();
else if (opt_output_format && opt_show)
#include "sigrok-cli.h"
gboolean opt_version = FALSE;
+gboolean opt_list_supported = FALSE;
gint opt_loglevel = SR_LOG_WARN; /* Show errors+warnings by default. */
gboolean opt_scan_devs = FALSE;
gboolean opt_wait_trigger = FALSE;
static const GOptionEntry optargs[] = {
{"version", 'V', 0, G_OPTION_ARG_NONE, &opt_version,
- "Show version and support list", NULL},
+ "Show version", NULL},
+ {"list-supported", 'L', 0, G_OPTION_ARG_NONE, &opt_list_supported,
+ "List supported devices/modules/decoders", NULL},
{"loglevel", 'l', 0, G_OPTION_ARG_INT, &opt_loglevel,
"Set loglevel (5 is most verbose)", NULL},
{"driver", 'd', 0, G_OPTION_ARG_CALLBACK, &check_opt_drv,
#endif
void show_version(void)
+{
+ printf("sigrok-cli %s\n\n", SC_PACKAGE_VERSION_STRING);
+
+ printf("Using libsigrok %s (lib version %s).\n",
+ sr_package_version_string_get(), sr_lib_version_string_get());
+#ifdef HAVE_SRD
+ printf("Using libsigrokdecode %s (lib version %s).\n\n",
+ srd_package_version_string_get(), srd_lib_version_string_get());
+#endif
+}
+
+void show_supported(void)
{
struct sr_dev_driver **drivers, *driver;
const struct sr_input_module **inputs, *input;
struct srd_decoder *dec;
#endif
- printf("sigrok-cli %s\n\n", SC_PACKAGE_VERSION_STRING);
-
- printf("Using libsigrok %s (lib version %s).\n",
- sr_package_version_string_get(), sr_lib_version_string_get());
-#ifdef HAVE_SRD
- printf("Using libsigrokdecode %s (lib version %s).\n\n",
- srd_package_version_string_get(), srd_lib_version_string_get());
-#endif
-
printf("Supported hardware drivers:\n");
drivers = sr_driver_list(sr_ctx);
for (sl = NULL, i = 0; drivers[i]; i++)
/* show.c */
void show_version(void);
+void show_supported(void);
void show_dev_list(void);
void show_dev_detail(void);
void show_pd_detail(void);
/* options.c */
extern gboolean opt_version;
+extern gboolean opt_list_supported;
extern gint opt_loglevel;
extern gboolean opt_scan_devs;
extern gboolean opt_wait_trigger;