Add import argument

This commit is contained in:
Gregory John Casamento 2023-07-02 12:05:21 -04:00
parent 8d0c4d107a
commit 493b2b6384

View file

@ -247,13 +247,39 @@ static NSMutableArray *__types = nil;
doc = [dc openDocumentWithContentsOfFile: file display: NO];
NSDebugLog(@"Document = %@", doc);
// Get the file to write out to...
NSString *outputFile = file;
opt = [args objectForKey: @"--write"];
if (opt != nil)
{
outputFile = [opt value];
}
// Get other options...
opt = [args objectForKey: @"--export-strings-file"];
if (opt != nil)
{
NSString *stringsFile = [opt value];
[doc exportStringsToFile: stringsFile];
}
}
else
{
opt = [args objectForKey: @"--import-strings-file"];
if (opt != nil)
{
NSString *stringsFile = [opt value];
[doc importStringsFromFile: stringsFile];
[doc saveToFile: outputFile
saveOperation: NSSaveOperation
delegate: nil
didSaveSelector: NULL
contextInfo: nil];
}
}
}
[NSClassSwapper setIsInInterfaceBuilder: NO];