104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
@"the archive\n"
@" -q --quiet Quiet mode (no output, "
@"except errors)\n"
@" -t --type= Archive type (gz, lha, tar, "
@"tgz, zip, zoo)\n"
@" -v --verbose Verbose output for file list"
@"\n"
@" -x --extract Extract files")];
}
[OFApplication terminateWithStatus: status];
}
static void
mutuallyExclusiveError(OFUnichar shortOption1, OFString *longOption1,
OFUnichar shortOption2, OFString *longOption2)
{
OFString *shortOption1Str = [OFString stringWithFormat: @"%C",
shortOption1];
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
@"the archive\n"
@" -q --quiet Quiet mode (no output, "
@"except errors)\n"
@" -t --type= Archive type (gz, lha, tar, "
@"tgz, zip, zoo)\n"
@" -v --verbose Verbose output for file list"
@"\n"
@" -x --extract Extract files\n"
@" --version Print the version "
@"information")];
}
[OFApplication terminateWithStatus: status];
}
static void
version(void)
{
[OFStdOut writeFormat: @"ofarc %@ (ObjFW %@) "
@"<https://objfw.nil.im/>\n"
@"Copyright (c) 2008-2025 Jonathan Schleifer "
@"<js@nil.im>\n"
@"Licensed under the LGPL 3.0 "
@"<https://www.gnu.org/licenses/lgpl-3.0.html>"
@"\n",
@PACKAGE_VERSION, [OFSystemInfo ObjFWVersion]];
[OFApplication terminate];
}
static void
mutuallyExclusiveError(OFUnichar shortOption1, OFString *longOption1,
OFUnichar shortOption2, OFString *longOption2)
{
OFString *shortOption1Str = [OFString stringWithFormat: @"%C",
shortOption1];
|
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
|
@implementation OFArc
- (void)applicationDidFinishLaunching: (OFNotification *)notification
{
OFString *archiveComment, *outputDir, *encodingString, *type;
bool isIRI;
const OFOptionsParserOption options[] = {
{ 'a', @"append", 0, NULL, NULL },
{ 0, @"archive-comment", 1, NULL, &archiveComment },
{ 'c', @"create", 0, NULL, NULL },
{ 'C', @"directory", 1, NULL, &outputDir },
{ 'E', @"encoding", 1, NULL, &encodingString },
{ 'f', @"force", 0, NULL, NULL },
{ 'h', @"help", 0, NULL, NULL },
{ 0, @"iri", 0, &isIRI, NULL },
{ 'l', @"list", 0, NULL, NULL },
{ 'n', @"no-clobber", 0, NULL, NULL },
{ 'p', @"print", 0, NULL, NULL },
{ 'q', @"quiet", 0, NULL, NULL },
{ 't', @"type", 1, NULL, &type },
{ 'v', @"verbose", 0, NULL, NULL },
{ 'x', @"extract", 0, NULL, NULL },
{ '\0', nil, 0, NULL, NULL }
};
OFUnichar option, mode = '\0';
OFStringEncoding encoding = OFStringEncodingAutodetect;
OFOptionsParser *optionsParser;
OFArray OF_GENERIC(OFString *) *remainingArguments, *files;
OFIRI *IRI;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
|
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
|
@implementation OFArc
- (void)applicationDidFinishLaunching: (OFNotification *)notification
{
OFString *archiveComment, *outputDir, *encodingString, *type;
bool isIRI;
const OFOptionsParserOption options[] = {
{ 'a', @"append", 0, NULL, NULL },
{ '\0', @"archive-comment", 1, NULL, &archiveComment },
{ 'c', @"create", 0, NULL, NULL },
{ 'C', @"directory", 1, NULL, &outputDir },
{ 'E', @"encoding", 1, NULL, &encodingString },
{ 'f', @"force", 0, NULL, NULL },
{ 'h', @"help", 0, NULL, NULL },
{ '\0', @"iri", 0, &isIRI, NULL },
{ 'l', @"list", 0, NULL, NULL },
{ 'n', @"no-clobber", 0, NULL, NULL },
{ 'p', @"print", 0, NULL, NULL },
{ 'q', @"quiet", 0, NULL, NULL },
{ 't', @"type", 1, NULL, &type },
{ 'v', @"verbose", 0, NULL, NULL },
{ 'x', @"extract", 0, NULL, NULL },
{ '\0', @"version", 0, NULL, NULL },
{ '\0', nil, 0, NULL, NULL }
};
OFUnichar option, mode = '\0';
OFStringEncoding encoding = OFStringEncodingAutodetect;
OFOptionsParser *optionsParser;
OFArray OF_GENERIC(OFString *) *remainingArguments, *files;
OFIRI *IRI;
|