aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/eolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-01-27 17:11:43 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-01-27 17:13:04 +0100
commitf84e7ddc7049fedd472b7b32b16e9beed583db87 (patch)
treee5ef0c0eb8381a2ba694938c99379852e8804b40 /src/bin/eolian
parentcmake: remove comment, it was my misunderstanding, not a bug. (diff)
downloadefl-f84e7ddc7049fedd472b7b32b16e9beed583db87.tar.gz
eolian gen: imply -gT if -o T:f is specified
If you specify type-explicit output filename, this automatically adds it so that it's generated even without specifying -gT. This is meant to help user friendliness. Also add a note about this to help listing.
Diffstat (limited to 'src/bin/eolian')
-rw-r--r--src/bin/eolian/main.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/bin/eolian/main.c b/src/bin/eolian/main.c
index 2e19d745f2..25324c9e82 100644
--- a/src/bin/eolian/main.c
+++ b/src/bin/eolian/main.c
@@ -52,7 +52,11 @@ _print_usage(const char *progn, FILE *outf)
"\n"
"By default, the 'hc' set is used ('h' for .eot files).\n"
"Output filenames are determined from input .eo filename.\n"
- "Default filenames include input extension. (e.g. \".eo.c\")\n");
+ "Default filenames include input extension. (e.g. \".eo.c\")\n"
+ "Default output path is where the input file is.\n\n"
+ "Also, specifying a type-dependent input file automatically\n"
+ "adds it to generated files, so if you specify those, you\n"
+ "don't need to explicitly specify -g for those types anymore.\n");
}
static void
@@ -62,25 +66,30 @@ _print_version(FILE *outf)
}
static Eina_Bool
-_try_set_out(char t, char **outs, const char *val)
+_try_set_out(char t, char **outs, const char *val, int *what)
{
int pos = -1;
switch (t)
{
case 'h':
pos = _get_bit_pos(GEN_H);
+ *what |= GEN_H;
break;
case 'l':
pos = _get_bit_pos(GEN_H_LEGACY);
+ *what |= GEN_H_LEGACY;
break;
case 's':
pos = _get_bit_pos(GEN_H_STUB);
+ *what |= GEN_H_STUB;
break;
case 'c':
pos = _get_bit_pos(GEN_C);
+ *what |= GEN_C;
break;
case 'i':
pos = _get_bit_pos(GEN_C_IMPL);
+ *what |= GEN_C_IMPL;
break;
}
if (pos < 0)
@@ -437,7 +446,8 @@ main(int argc, char **argv)
{
const char *abeg = optarg;
const char *cpos = strchr(abeg, ':');
- if (((cpos - abeg) != 1) || !_try_set_out(*abeg, outs, cpos + 1))
+ if (((cpos - abeg) != 1) ||
+ !_try_set_out(*abeg, outs, cpos + 1, &gen_what))
{
char *oa = strdup(abeg);
oa[cpos - abeg] = '\0';