firasuke / cross / slibtool

Forked from cross/slibtool 6 months ago
Clone

37ff4a driver: accept --config even when no --mode has been specified.

Authored and Committed by midipix 8 years ago
    driver: accept --config even when no --mode has been specified.
    
        
file modified
+5 -2
src/driver/slbt_driver_ctx.c CHANGED
@@ -115,6 +115,7 @@ static int slbt_split_argv(
115
115
struct argv_meta * meta;
116
116
struct argv_entry * entry;
117
117
struct argv_entry * mode;
118
+ struct argv_entry * config;
118
119
const struct argv_option * option;
119
120
const struct argv_option * options = slbt_default_options;
120
121
struct argv_ctx ctx = {ARGV_VERBOSITY_NONE,
@@ -155,14 +156,16 @@ static int slbt_split_argv(
155
156
meta = argv_get(argv,options,ARGV_VERBOSITY_NONE);
156
157
argv[ctx.unitidx] = compiler;
157
158
158
- /* missing --mode? */
159
+ /* missing both --mode and --config? */
159
160
for (mode=0, entry=meta->entries; entry->fopt; entry++)
160
161
if (entry->tag == TAG_MODE)
161
162
mode = entry;
163
+ else if (entry->tag == TAG_CONFIG)
164
+ config = entry;
162
165
163
166
argv_free(meta);
164
167
165
- if (!mode) {
168
+ if (!mode && !config) {
166
169
fprintf(stderr,
167
170
"%s: error: --mode must be specified.\n",
168
171
program);