mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Add import argument
This commit is contained in:
parent
8d0c4d107a
commit
493b2b6384
1 changed files with 27 additions and 1 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue