summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-03 16:36:39 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-03 22:18:29 (GMT)
commit91c6bc93281cd79d69d13caa9aa4f7f0df262044 (patch)
tree82d87631357e6572ac4602b108a704b458f2c097 /gfx
parentc8b5418ada13b5e30a524b7f87d50865bef27f30 (diff)
downloadeeshow-91c6bc93281cd79d69d13caa9aa4f7f0df262044.zip
eeshow-91c6bc93281cd79d69d13caa9aa4f7f0df262044.tar.gz
eeshow-91c6bc93281cd79d69d13caa9aa4f7f0df262044.tar.bz2
gfx/: ignore foo: prefix in output file names
Note sure if this is the best place for it. We could also tweak argv in the respective main.
Diffstat (limited to 'gfx')
-rw-r--r--gfx/cro.c4
-rw-r--r--gfx/diff.c4
-rw-r--r--gfx/fig.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index 9dd57de..588aad2 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -508,12 +508,14 @@ static void setup_font(struct cro_ctx *cc)
static bool cr_args(void *ctx, int argc, char *const *argv)
{
struct cro_ctx *cc = ctx;
+ const char *colon;
char c;
while ((c = getopt(argc, argv, "o:s:T")) != EOF)
switch (c) {
case 'o':
- cc->output_name = optarg;
+ colon = strchr(optarg, ':');
+ cc->output_name = colon ? colon + 1 : optarg;
break;
case 's':
cc->scale = atof(optarg) * cc->default_scale;
diff --git a/gfx/diff.c b/gfx/diff.c
index 5140dce..08554a0 100644
--- a/gfx/diff.c
+++ b/gfx/diff.c
@@ -153,6 +153,7 @@ static void *diff_init(void)
static bool diff_args(void *ctx, int argc, char *const *argv)
{
struct diff *diff = ctx;
+ const char *colon;
char c;
unsigned i;
struct file_names file_names;
@@ -168,7 +169,8 @@ static bool diff_args(void *ctx, int argc, char *const *argv)
while ((c = getopt(argc, argv, "o:s:")) != EOF)
switch (c) {
case 'o':
- diff->output_name = optarg;
+ colon = strchr(optarg, ':');
+ diff->output_name = colon ? colon + 1 : optarg;
break;
case 's':
diff->scale = atof(optarg) * DEFAULT_SCALE;
diff --git a/gfx/fig.c b/gfx/fig.c
index 8ae7721..a60e41b 100644
--- a/gfx/fig.c
+++ b/gfx/fig.c
@@ -297,6 +297,7 @@ static bool fig_args(void *ctx, int argc, char *const *argv)
const char *template = NULL;
const char **vars = NULL;
int n_vars = 0;
+ const char *colon;
char c;
FILE *file;
int lines_to_colors = 8;
@@ -304,7 +305,8 @@ static bool fig_args(void *ctx, int argc, char *const *argv)
while ((c = getopt(argc, argv, "o:t:D:")) != EOF)
switch (c) {
case 'o':
- output = optarg;
+ colon = strchr(optarg, ':');
+ output = colon ? colon + 1 : optarg;
break;
case 't':
template = optarg;