Index: utils/ofzip/OFZIP.m ================================================================== --- utils/ofzip/OFZIP.m +++ utils/ofzip/OFZIP.m @@ -44,17 +44,19 @@ static void help(OFStream *stream, bool full, int status) { [stream writeLine: OF_LOCALIZED(@"usage", - @"Usage: %[prog] -[fhlnpqtvx] archive.zip [file1 file2 ...]", + @"Usage: %[prog] -[Cfhlnpqtvx] archive.zip [file1 file2 ...]", @"prog", [OFApplication programName])]; if (full) { [stream writeString: @"\n"]; [stream writeLine: OF_LOCALIZED(@"full_usage", @"Options:\n" + @" -C --directory Extract into the specified directory" + @"\n" @" -f --force Force / overwrite files\n" @" -h --help Show this help\n" @" -l --list List all files in the archive\n" @" -n --no-clober Never overwrite files\n" @" -p --print Print one or more files from the " @@ -115,12 +117,13 @@ } @implementation OFZIP - (void)applicationDidFinishLaunching { - OFString *type = nil; + OFString *outputDir = nil, *type = nil; const of_options_parser_option_t options[] = { + { 'C', @"directory", 1, NULL, &outputDir }, { 'f', @"force", 0, NULL, NULL }, { 'h', @"help", 0, NULL, NULL }, { 'l', @"list", 0, NULL, NULL }, { 'n', @"no-clobber", 0, NULL, NULL }, { 'p', @"print", 0, NULL, NULL }, @@ -214,10 +217,14 @@ remainingArguments = [optionsParser remainingArguments]; archive = [self openArchiveWithPath: [remainingArguments firstObject] type: type]; + if (outputDir != nil) + [[OFFileManager defaultManager] + changeCurrentDirectoryPath: outputDir]; + switch (mode) { case 'l': if ([remainingArguments count] != 1) help(of_stderr, false, 1); Index: utils/ofzip/lang/de.json ================================================================== --- utils/ofzip/lang/de.json +++ utils/ofzip/lang/de.json @@ -1,11 +1,12 @@ { "usage": [ - "Benutzung: %[prog] -[fhlnpqtvx] archiv.zip [datei1 datei2 ...]" + "Benutzung: %[prog] -[Cfhlnpqtvx] archiv.zip [datei1 datei2 ...]" ], "full_usage": [ "Optionen:\n", + " -C --directory In angegebenes Verzeichnis entpacken\n", " -f --force Existierende Dateien überschreiben\n", " -h --help Diese Hilfe anzeigen\n", " -l --list Alle Dateien im Archiv auflisten\n", " -n --no-clober Dateien niemals überschreiben\n", " -p --print Eine oder mehr Dateien aus dem Archiv ausgeben\n",