]> sigrok.org Git - sigrok-cli.git/commitdiff
opt_to_gvar: print an error message for unsupported data types
authorBartosz Golaszewski <redacted>
Thu, 4 Dec 2014 16:27:06 +0000 (17:27 +0100)
committerUwe Hermann <redacted>
Sat, 3 Jan 2015 18:15:54 +0000 (19:15 +0100)
Unsupported data types are silently ignored in opt_to_gvar() switch
statement. This leads to confusion as sigrok-cli just exits without
giving the user any hint on what's the reason for not setting the option
properly.

Add an error message for unmatched data types.

Signed-off-by: Bartosz Golaszewski <redacted>
session.c

index 0011445df9ebd2dd2281cb2610b21b9cbeca79e3..7bae91ac5c920235b71ed680cc517c4c1c80ba3d 100644 (file)
--- a/session.c
+++ b/session.c
@@ -404,6 +404,8 @@ int opt_to_gvar(char *key, char *value, struct sr_config *src)
                }
                break;
        default:
+               g_critical("Unknown data type specified for option '%s' "
+                          "(driver implementation bug?).", key);
                ret = -1;
        }