Differences From Artifact [d383d3b508]:
- File
utils/ofzip/OFZIP.m
— part of check-in
[6b13727ce0]
at
2015-11-29 14:02:11
on branch trunk
— Make use of fast enumeration
Now that we require GCC >= 4.6 anyway, there's no more reason to not use
it anymore. (user: js, size: 12165) [annotate] [blame] [check-ins using]
To Artifact [7e146b0671]:
- File utils/ofzip/OFZIP.m — part of check-in [227351155f] at 2015-12-05 21:23:06 on branch trunk — of{http,zip}: Better documentation of long options (user: js, size: 12542) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
64 65 66 67 68 69 70 | [stream writeFormat: @"Usage: %@ -[fhlnqvx] archive.zip [file1 file2 ...]\n", [OFApplication programName]]; if (full) [stream writeString: @"\nOptions:\n" | | | | | | > | | | > | > | | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | [stream writeFormat: @"Usage: %@ -[fhlnqvx] archive.zip [file1 file2 ...]\n", [OFApplication programName]]; if (full) [stream writeString: @"\nOptions:\n" @" -f --force Force / override files\n" @" -h --help Show this help\n" @" -l --list List all files in the archive\n" @" -n --no-clober Never override files\n" @" -q --quiet Quiet mode (no output, except " @"errors)\n" @" -v --verbose Verbose output for file list\n" @" -x --extract Extract files\n"]; [OFApplication terminateWithStatus: status]; } static void mutuallyExclusiveError(of_unichar_t shortOption1, OFString *longOption1, of_unichar_t shortOption2, OFString *longOption2) { [of_stderr writeFormat: @"Error: -%C / --%@ and -%C / --%@ are mutually exclusive!\n", shortOption1, longOption1, shortOption2, longOption2]; [OFApplication terminateWithStatus: 1]; } static void setPermissions(OFString *path, OFZIPArchiveEntry *entry) { #ifdef OF_HAVE_CHMOD |
︙ | ︙ | |||
124 125 126 127 128 129 130 | OFArray OF_GENERIC(OFString*) *remainingArguments, *files; OFZIPArchive *archive; while ((option = [optionsParser nextOption]) != '\0') { switch (option) { case 'f': if (_override < 0) | | > | > | > | > | > | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | OFArray OF_GENERIC(OFString*) *remainingArguments, *files; OFZIPArchive *archive; while ((option = [optionsParser nextOption]) != '\0') { switch (option) { case 'f': if (_override < 0) mutuallyExclusiveError( 'f', @"force", 'n', @"no-clobber"); _override = 1; break; case 'n': if (_override > 0) mutuallyExclusiveError( 'f', @"force", 'n', @"no-clobber"); _override = -1; break; case 'v': if (_outputLevel < 0) mutuallyExclusiveError( 'q', @"quiet", 'v', @"verbose"); _outputLevel++; break; case 'q': if (_outputLevel > 0) mutuallyExclusiveError( 'q', @"quiet", 'v', @"verbose"); _outputLevel--; break; case 'l': case 'x': if (mode != '\0') mutuallyExclusiveError( 'l', @"list", 'x', @"extract"); mode = option; break; case 'h': help(of_stdout, true, 0); break; case '=': |
︙ | ︙ |