summaryrefslogtreecommitdiff
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
parent2aeccd16f37edb1d4049f242c37478290472103e (diff)
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.
-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)
52 "\n" 52 "\n"
53 "By default, the 'hc' set is used ('h' for .eot files).\n" 53 "By default, the 'hc' set is used ('h' for .eot files).\n"
54 "Output filenames are determined from input .eo filename.\n" 54 "Output filenames are determined from input .eo filename.\n"
55 "Default filenames include input extension. (e.g. \".eo.c\")\n"); 55 "Default filenames include input extension. (e.g. \".eo.c\")\n"
56 "Default output path is where the input file is.\n\n"
57 "Also, specifying a type-dependent input file automatically\n"
58 "adds it to generated files, so if you specify those, you\n"
59 "don't need to explicitly specify -g for those types anymore.\n");
56} 60}
57 61
58static void 62static void
@@ -62,25 +66,30 @@ _print_version(FILE *outf)
62} 66}
63 67
64static Eina_Bool 68static Eina_Bool
65_try_set_out(char t, char **outs, const char *val) 69_try_set_out(char t, char **outs, const char *val, int *what)
66{ 70{
67 int pos = -1; 71 int pos = -1;
68 switch (t) 72 switch (t)
69 { 73 {
70 case 'h': 74 case 'h':
71 pos = _get_bit_pos(GEN_H); 75 pos = _get_bit_pos(GEN_H);
76 *what |= GEN_H;
72 break; 77 break;
73 case 'l': 78 case 'l':
74 pos = _get_bit_pos(GEN_H_LEGACY); 79 pos = _get_bit_pos(GEN_H_LEGACY);
80 *what |= GEN_H_LEGACY;
75 break; 81 break;
76 case 's': 82 case 's':
77 pos = _get_bit_pos(GEN_H_STUB); 83 pos = _get_bit_pos(GEN_H_STUB);
84 *what |= GEN_H_STUB;
78 break; 85 break;
79 case 'c': 86 case 'c':
80 pos = _get_bit_pos(GEN_C); 87 pos = _get_bit_pos(GEN_C);
88 *what |= GEN_C;
81 break; 89 break;
82 case 'i': 90 case 'i':
83 pos = _get_bit_pos(GEN_C_IMPL); 91 pos = _get_bit_pos(GEN_C_IMPL);
92 *what |= GEN_C_IMPL;
84 break; 93 break;
85 } 94 }
86 if (pos < 0) 95 if (pos < 0)
@@ -437,7 +446,8 @@ main(int argc, char **argv)
437 { 446 {
438 const char *abeg = optarg; 447 const char *abeg = optarg;
439 const char *cpos = strchr(abeg, ':'); 448 const char *cpos = strchr(abeg, ':');
440 if (((cpos - abeg) != 1) || !_try_set_out(*abeg, outs, cpos + 1)) 449 if (((cpos - abeg) != 1) ||
450 !_try_set_out(*abeg, outs, cpos + 1, &gen_what))
441 { 451 {
442 char *oa = strdup(abeg); 452 char *oa = strdup(abeg);
443 oa[cpos - abeg] = '\0'; 453 oa[cpos - abeg] = '\0';