summaryrefslogtreecommitdiff
path: root/gfx/gfx.c
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gfx.c')
-rw-r--r--gfx/gfx.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gfx/gfx.c b/gfx/gfx.c
index 2599131..e49160c 100644
--- a/gfx/gfx.c
+++ b/gfx/gfx.c
@@ -121,10 +121,18 @@ struct gfx *gfx_init(const struct gfx_ops *ops)
}
-bool gfx_args(struct gfx *gfx, int argc, char *const *argv)
+bool gfx_args(struct gfx *gfx, int argc, char *const *argv, const char *opts)
{
+ char *combined = (char *) opts;
+ bool res;
+
+ if (gfx->ops->opts)
+ alloc_printf(&combined, "%s%s", opts, gfx->ops->opts);
optind = 0;
- return gfx->ops->args && gfx->ops->args(gfx->user, argc, argv);
+ res = gfx->ops->args && gfx->ops->args(gfx->user, argc, argv, combined);
+ if (gfx->ops->opts)
+ free(combined);
+ return res;
}