Skip to content

Commit ace9543

Browse files
committed
Added support for '-defaultTable' parameter
1 parent dd8e2f0 commit ace9543

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Demo/Source/main.m

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ int main (int argc, const char *argv[])
2929
BOOL wantsDecodedUnicodeSequences = NO;
3030
NSMutableSet *tablesToSkip = [NSMutableSet set];
3131
NSString *customMacroPrefix = nil;
32+
NSString *customTableName = nil;
3233

3334
// analyze options
3435
BOOL optionsInvalid = NO;
@@ -138,6 +139,19 @@ int main (int argc, const char *argv[])
138139
{
139140
inputStringEncoding = NSMacOSRomanStringEncoding;
140141
}
142+
else if (!strcmp("-defaultTable", argv[i]))
143+
{
144+
i++;
145+
146+
if (i>=argc)
147+
{
148+
// table name is missing
149+
optionsInvalid = YES;
150+
break;
151+
}
152+
153+
customTableName = [NSString stringWithUTF8String:argv[i]];
154+
}
141155

142156
i++;
143157
}
@@ -156,6 +170,8 @@ int main (int argc, const char *argv[])
156170
aggregator.wantsPositionalParameters = wantsPositionalParameters;
157171
aggregator.inputEncoding = inputStringEncoding;
158172
aggregator.customMacroPrefix = customMacroPrefix;
173+
aggregator.tablesToSkip = tablesToSkip;
174+
aggregator.customTableName = customTableName;
159175

160176
// go, go, go!
161177
for (NSURL *file in files) {
@@ -216,6 +232,7 @@ void showUsage(void)
216232
printf(" -bigEndian output generated with big endian byte order.\n");
217233
printf(" -littleEndian output generated with little endian byte order.\n");
218234
printf(" -o dir place output files in 'dir'.\n\n");
235+
printf(" -defaultTable tablename use 'tablename' instead of 'Localizable' as default table name.\n");
219236
printf(" Please see the genstrings2(1) man page for full documentation\n");
220237
}
221238

0 commit comments

Comments
 (0)