@@ -87,11 +87,11 @@ OFString *shortOption1Str = [OFString stringWithFormat: @"%C", shortOption1]; OFString *shortOption2Str = [OFString stringWithFormat: @"%C", shortOption2]; - [of_stderr writeLine: OF_LOCALIZED(@"2_options_mutually_exclusive", + [OFStdErr writeLine: OF_LOCALIZED(@"2_options_mutually_exclusive", @"Error: -%[shortopt1] / --%[longopt1] and " @"-%[shortopt2] / --%[longopt2] " @"are mutually exclusive!", @"shortopt1", shortOption1Str, @"longopt1", longOption1, @@ -116,11 +116,11 @@ OFString *shortOption4Str = [OFString stringWithFormat: @"%C", shortOption4]; OFString *shortOption5Str = [OFString stringWithFormat: @"%C", shortOption5]; - [of_stderr writeLine: OF_LOCALIZED(@"5_options_mutually_exclusive", + [OFStdErr writeLine: OF_LOCALIZED(@"5_options_mutually_exclusive", @"Error: -%[shortopt1] / --%[longopt1], " @"-%[shortopt2] / --%[longopt2], -%[shortopt3] / --%[longopt3], " @"-%[shortopt4] / --%[longopt4] and\n" @" -%[shortopt5] / --%[longopt5] are mutually exclusive!", @"shortopt1", shortOption1Str, @@ -137,11 +137,11 @@ } static void writingNotSupported(OFString *type) { - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"writing_not_supported", @"Writing archives of type %[type] is not (yet) supported!", @"type", type)]; } @@ -236,34 +236,34 @@ 'x', @"extract"); mode = option; break; case 'h': - help(of_stdout, true, 0); + help(OFStdOut, true, 0); break; case '=': - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"option_takes_no_argument", @"%[prog]: Option --%[opt] takes no argument", @"prog", [OFApplication programName], @"opt", optionsParser.lastLongOption)]; [OFApplication terminateWithStatus: 1]; break; case ':': if (optionsParser.lastLongOption != nil) - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"long_option_requires_argument", @"%[prog]: Option --%[opt] requires an " @"argument", @"prog", [OFApplication programName], @"opt", optionsParser.lastLongOption)]; else { OFString *optStr = [OFString stringWithFormat: @"%C", optionsParser.lastOption]; - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"option_requires_argument", @"%[prog]: Option -%[opt] requires an " @"argument", @"prog", [OFApplication programName], @"opt", optStr)]; @@ -271,20 +271,20 @@ [OFApplication terminateWithStatus: 1]; break; case '?': if (optionsParser.lastLongOption != nil) - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"unknown_long_option", @"%[prog]: Unknown option: --%[opt]", @"prog", [OFApplication programName], @"opt", optionsParser.lastLongOption)]; else { OFString *optStr = [OFString stringWithFormat: @"%C", optionsParser.lastOption]; - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"unknown_option", @"%[prog]: Unknown option: -%[opt]", @"prog", [OFApplication programName], @"opt", optStr)]; } @@ -296,11 +296,11 @@ @try { if (encodingString != nil) encoding = OFStringEncodingParseName(encodingString); } @catch (OFInvalidArgumentException *e) { - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"invalid_encoding", @"%[prog]: Invalid encoding: %[encoding]", @"prog", [OFApplication programName], @"encoding", encodingString)]; @@ -311,11 +311,11 @@ switch (mode) { case 'a': case 'c': if (remainingArguments.count < 1) - help(of_stderr, false, 1); + help(OFStdErr, false, 1); files = [remainingArguments objectsInRange: OFRangeMake(1, remainingArguments.count - 1)]; #ifdef OF_HAVE_SANDBOX @@ -338,11 +338,11 @@ [archive addFiles: files]; break; case 'l': if (remainingArguments.count != 1) - help(of_stderr, false, 1); + help(OFStdErr, false, 1); #ifdef OF_HAVE_SANDBOX if (![remainingArguments.firstObject isEqual: @"-"]) [sandbox unveilPath: remainingArguments.firstObject permissions: @"r"]; @@ -359,11 +359,11 @@ [archive listFiles]; break; case 'p': if (remainingArguments.count < 1) - help(of_stderr, false, 1); + help(OFStdErr, false, 1); #ifdef OF_HAVE_SANDBOX if (![remainingArguments.firstObject isEqual: @"-"]) [sandbox unveilPath: remainingArguments.firstObject permissions: @"r"]; @@ -383,11 +383,11 @@ [archive printFiles: files]; break; case 'x': if (remainingArguments.count < 1) - help(of_stderr, false, 1); + help(OFStdErr, false, 1); files = [remainingArguments objectsInRange: OFRangeMake(1, remainingArguments.count - 1)]; #ifdef OF_HAVE_SANDBOX @@ -430,33 +430,33 @@ [archive extractFiles: files]; } @catch (OFCreateDirectoryFailedException *e) { OFString *error = [OFString stringWithCString: strerror(e.errNo) encoding: [OFLocale encoding]]; - [of_stderr writeString: @"\r"]; - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeString: @"\r"]; + [OFStdErr writeLine: OF_LOCALIZED( @"failed_to_create_directory", @"Failed to create directory %[dir]: %[error]", @"dir", e.URL.fileSystemRepresentation, @"error", error)]; _exitStatus = 1; } @catch (OFOpenItemFailedException *e) { OFString *error = [OFString stringWithCString: strerror(e.errNo) encoding: [OFLocale encoding]]; - [of_stderr writeString: @"\r"]; - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeString: @"\r"]; + [OFStdErr writeLine: OF_LOCALIZED( @"failed_to_open_file", @"Failed to open file %[file]: %[error]", @"file", e.path, @"error", error)]; _exitStatus = 1; } break; default: - help(of_stderr, true, 1); + help(OFStdErr, true, 1); break; } [OFApplication terminateWithStatus: _exitStatus]; } @@ -495,16 +495,16 @@ if ([path isEqual: @"-"]) { switch (mode) { case 'a': case 'c': - file = of_stdout; + file = OFStdOut; break; case 'l': case 'p': case 'x': - file = of_stdin; + file = OFStdIn; break; default: @throw [OFInvalidArgumentException exception]; } } else { @@ -512,12 +512,12 @@ file = [OFFile fileWithPath: path mode: fileModeString]; } @catch (OFOpenItemFailedException *e) { OFString *error = [OFString stringWithCString: strerror(e.errNo) encoding: [OFLocale encoding]]; - [of_stderr writeString: @"\r"]; - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeString: @"\r"]; + [OFStdErr writeLine: OF_LOCALIZED( @"failed_to_open_file", @"Failed to open file %[file]: %[error]", @"file", e.path, @"error", error)]; [OFApplication terminateWithStatus: 1]; @@ -562,11 +562,11 @@ } else if ([type isEqual: @"zip"]) archive = [ZIPArchive archiveWithStream: file mode: modeString encoding: encoding]; else { - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"unknown_archive_type", @"Unknown archive type: %[type]", @"type", type)]; goto error; } @@ -580,26 +580,26 @@ @throw e; } @catch (OFReadFailedException *e) { OFString *error = [OFString stringWithCString: strerror(e.errNo) encoding: [OFLocale encoding]]; - [of_stderr writeLine: OF_LOCALIZED(@"failed_to_read_file", + [OFStdErr writeLine: OF_LOCALIZED(@"failed_to_read_file", @"Failed to read file %[file]: %[error]", @"file", path, @"error", error)]; goto error; } @catch (OFSeekFailedException *e) { OFString *error = [OFString stringWithCString: strerror(e.errNo) encoding: [OFLocale encoding]]; - [of_stderr writeLine: OF_LOCALIZED(@"failed_to_seek_in_file", + [OFStdErr writeLine: OF_LOCALIZED(@"failed_to_seek_in_file", @"Failed to seek in file %[file]: %[error]", @"file", path, @"error", error)]; goto error; } @catch (OFInvalidFormatException *e) { - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"file_is_not_a_valid_archive", @"File %[file] is not a valid archive!", @"file", path)]; goto error; } @@ -629,28 +629,28 @@ ![[OFFileManager defaultManager] fileExistsAtPath: outFileName]) return true; if (_overwrite == -1) { if (_outputLevel >= 0) { - [of_stdout writeString: @" "]; - [of_stdout writeLine: + [OFStdOut writeString: @" "]; + [OFStdOut writeLine: OF_LOCALIZED(@"file_skipped", @"skipped")]; } return false; } do { - [of_stderr writeString: @"\r"]; - [of_stderr writeString: OF_LOCALIZED(@"ask_overwrite", + [OFStdErr writeString: @"\r"]; + [OFStdErr writeString: OF_LOCALIZED(@"ask_overwrite", @"Overwrite %[file]? [ynAN?]", @"file", fileName)]; - [of_stderr writeString: @" "]; + [OFStdErr writeString: @" "]; - line = [of_stdin readLine]; + line = [OFStdIn readLine]; if ([line isEqual: @"?"]) - [of_stderr writeLine: OF_LOCALIZED( + [OFStdErr writeLine: OF_LOCALIZED( @"ask_overwrite_help", @" y: yes\n" @" n: no\n" @" A: always\n" @" N: never")]; @@ -662,19 +662,19 @@ else if ([line isEqual: @"N"]) _overwrite = -1; if ([line isEqual: @"n"] || [line isEqual: @"N"]) { if (_outputLevel >= 0) - [of_stdout writeLine: OF_LOCALIZED(@"skipping_file", + [OFStdOut writeLine: OF_LOCALIZED(@"skipping_file", @"Skipping %[file]...", @"file", fileName)]; return false; } if (_outputLevel >= 0) - [of_stdout writeString: OF_LOCALIZED(@"extracting_file", + [OFStdOut writeString: OF_LOCALIZED(@"extracting_file", @"Extracting %[file]...", @"file", fileName)]; return true; } @@ -690,12 +690,12 @@ length = [input readIntoBuffer: buffer length: BUFFER_SIZE]; } @catch (OFReadFailedException *e) { OFString *error = [OFString stringWithCString: strerror(e.errNo) encoding: [OFLocale encoding]]; - [of_stdout writeString: @"\r"]; - [of_stderr writeLine: OF_LOCALIZED(@"failed_to_read_file", + [OFStdOut writeString: @"\r"]; + [OFStdErr writeLine: OF_LOCALIZED(@"failed_to_read_file", @"Failed to read file %[file]: %[error]", @"file", fileName, @"error", error)]; return -1; } @@ -704,12 +704,12 @@ [output writeBuffer: buffer length: length]; } @catch (OFWriteFailedException *e) { OFString *error = [OFString stringWithCString: strerror(e.errNo) encoding: [OFLocale encoding]]; - [of_stdout writeString: @"\r"]; - [of_stderr writeLine: OF_LOCALIZED(@"failed_to_write_file", + [OFStdOut writeString: @"\r"]; + [OFStdErr writeLine: OF_LOCALIZED(@"failed_to_write_file", @"Failed to write file %[file]: %[error]", @"file", fileName, @"error", error)]; return -1; }