Differences From Artifact [545bac3fa9]:
- File
utils/ofhttp/OFHTTP.m
— part of check-in
[ba62f00fac]
at
2015-11-29 14:20:53
on branch trunk
— Clean up optional protocols
Now that we can require GCC >= 4.6, we no longer need to have a category
on OFObject that adds the optional protocol to it. (user: js, size: 19765) [annotate] [blame] [check-ins using]
To Artifact [4ffeaaca45]:
- File utils/ofhttp/OFHTTP.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: 20101) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
74 75 76 77 78 79 80 |
{
[of_stderr writeFormat:
@"Usage: %@ -[cehHmoOPqv] url1 [url2 ...]\n",
[OFApplication programName]];
if (full)
[stream writeString:
| | > | > | > | > | > | > | > | > | > | > | | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
{
[of_stderr writeFormat:
@"Usage: %@ -[cehHmoOPqv] url1 [url2 ...]\n",
[OFApplication programName]];
if (full)
[stream writeString:
@"\nOptions:\n "
@"-b --body "
@" Specify the file to send as body\n "
@"-c --continue "
@" Continue download of existing file\n "
@"-h --help "
@" Show this help\n "
@"-H --header "
@" Add a header (e.g. X-Foo:Bar)\n "
@"-m --method "
@" Set the method of the HTTP request\n "
@"-o --output "
@" Specify output file name\n "
@"-O --detect-filename"
@" Do a HEAD request to detect the file name\n "
@"-P --proxy "
@" Specify SOCKS5 proxy\n "
@"-q --quiet "
@" Quiet mode (no output, except errors)\n "
@"-v --verbose "
@" Verbose mode (print headers)\n"];
[OFApplication terminateWithStatus: status];
}
@implementation OFHTTP
- init
{
|
| ︙ | ︙ | |||
290 291 292 293 294 295 296 |
_outputPath = [outputPath copy];
_URLs = [[optionsParser remainingArguments] retain];
if ([_URLs count] < 1)
help(of_stderr, false, 1);
if (_quiet && _verbose) {
| | | | > | | 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
_outputPath = [outputPath copy];
_URLs = [[optionsParser remainingArguments] retain];
if ([_URLs count] < 1)
help(of_stderr, false, 1);
if (_quiet && _verbose) {
[of_stderr writeFormat: @"%@: -q / --quiet and -v / --verbose "
@"are mutually exclusive!\n",
[OFApplication programName]];
[OFApplication terminateWithStatus: 1];
}
if (_outputPath != nil && [_URLs count] > 1) {
[of_stderr writeFormat: @"%@: Cannot use -o / --output when "
@"more than one URL has been "
@"specified!\n",
[OFApplication programName]];
[OFApplication terminateWithStatus: 1];
}
[self performSelector: @selector(downloadNextURL)
afterDelay: 0];
}
|
| ︙ | ︙ |