aboutsummaryrefslogtreecommitdiff
path: root/opts.c
diff options
context:
space:
mode:
Diffstat (limited to 'opts.c')
-rw-r--r--opts.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/opts.c b/opts.c
index 4495b80..4a70a03 100644
--- a/opts.c
+++ b/opts.c
@@ -119,3 +119,12 @@ int opt_get_unsigned(const struct opt *o, unsigned *valp)
*valp = val;
return 0;
}
+
+char *opt_get_string(const struct opt *o)
+{
+ if (!o->value || !o->value[0]) {
+ fprintf(stderr, "Missing value for '%s' option\n", o->optname);
+ return NULL;
+ }
+ return o->value;
+}