Overview
Comment: | ofdns: Allow repeating -t |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
21d9b806259bc2ca3a594639e29ebdad |
User & Date: | js on 2020-03-23 00:58:39 |
Other Links: | manifest | tags |
Context
2020-03-23
| ||
01:03 | of_dns_record_type_parse(): Allow ALL check-in: 103f04241c user: js tags: trunk | |
00:58 | ofdns: Allow repeating -t check-in: 21d9b80625 user: js tags: trunk | |
00:35 | ofdns: Add German translation check-in: c1db390649 user: js tags: trunk | |
Changes
Modified utils/ofdns/OFDNS.m from [2b778189ed] to [7cbfa15818].
︙ | ︙ | |||
49 50 51 52 53 54 55 | @"-c --class " @" The DNS class to query (defaults to IN)\n " @"-h --help " @" Show this help\n " @"-s --server" @" The server to query\n " @"-t --type " | | > | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | @"-c --class " @" The DNS class to query (defaults to IN)\n " @"-h --help " @" Show this help\n " @"-s --server" @" The server to query\n " @"-t --type " @" The record type to query (defaults to ALL, can be " @"repeated)")]; } [OFApplication terminateWithStatus: status]; } @implementation OFDNS - (void)resolver: (OFDNSResolver *)resolver |
︙ | ︙ | |||
79 80 81 82 83 84 85 | if (_inFlight == 0) [OFApplication terminateWithStatus: _errors]; } - (void)applicationDidFinishLaunching { | | | > < > > > > > | 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 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 | if (_inFlight == 0) [OFApplication terminateWithStatus: _errors]; } - (void)applicationDidFinishLaunching { OFString *DNSClassString, *server; const of_options_parser_option_t options[] = { { 'c', @"class", 1, NULL, &DNSClassString }, { 'h', @"help", 0, NULL, NULL }, { 's', @"server", 1, NULL, &server }, { 't', @"type", 1, NULL, NULL }, { '\0', nil, 0, NULL, NULL } }; OFMutableArray OF_GENERIC(OFString *) *recordTypes; OFOptionsParser *optionsParser; of_unichar_t option; OFArray OF_GENERIC(OFString *) *remainingArguments; OFDNSResolver *resolver; of_dns_class_t DNSClass; #ifdef OF_HAVE_FILES # ifndef OF_AMIGAOS [OFLocale addLanguageDirectory: @LANGUAGE_DIR]; # else [OFLocale addLanguageDirectory: @"PROGDIR:/share/ofdns/lang"]; # endif #endif #ifdef OF_HAVE_SANDBOX OFSandbox *sandbox = [[OFSandbox alloc] init]; @try { sandbox.allowsStdIO = true; sandbox.allowsDNS = true; [OFApplication activateSandbox: sandbox]; } @finally { [sandbox release]; } #endif recordTypes = [OFMutableArray array]; optionsParser = [OFOptionsParser parserWithOptions: options]; while ((option = [optionsParser nextOption]) != '\0') { switch (option) { case 't': [recordTypes addObject: optionsParser.argument]; break; case 'h': help(of_stdout, true, 0); break; case ':': if (optionsParser.lastLongOption != nil) [of_stderr writeLine: OF_LOCALIZED( @"long_option_required_argument", |
︙ | ︙ | |||
171 172 173 174 175 176 177 | remainingArguments = optionsParser.remainingArguments; if (remainingArguments.count < 1) help(of_stderr, false, 1); resolver = [OFDNSResolver resolver]; | < < < > > > < > > > | | | | > | | > | 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | remainingArguments = optionsParser.remainingArguments; if (remainingArguments.count < 1) help(of_stderr, false, 1); resolver = [OFDNSResolver resolver]; DNSClass = (DNSClassString != nil ? of_dns_class_parse(DNSClassString) : OF_DNS_CLASS_IN); if (recordTypes.count == 0) [recordTypes addObject: @"ALL"]; if (server != nil) { resolver.configReloadInterval = 0; resolver.nameServers = [OFArray arrayWithObject: server]; } for (OFString *domainName in remainingArguments) { for (OFString *recordTypeString in recordTypes) { of_dns_record_type_t recordType = of_dns_record_type_parse(recordTypeString); OFDNSQuery *query = [OFDNSQuery queryWithDomainName: domainName DNSClass: DNSClass recordType: recordType]; _inFlight++; [resolver asyncPerformQuery: query delegate: self]; } } } @end |
Modified utils/ofdns/lang/de.json from [e3d5a9129f] to [a2dd6e542b].
1 2 3 4 5 6 7 | { "usage": "Benutzung: %[prog] -[chst] domain1 [domain2 ...]", "full_usage": [ "Optionen:\n", " -c --class Die anzufragende DNS-Klasse (standardmäßig IN)\n", " -h --help Diese Hilfe anzeigen\n", " -s --server Der abzufragende Server\n", | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | { "usage": "Benutzung: %[prog] -[chst] domain1 [domain2 ...]", "full_usage": [ "Optionen:\n", " -c --class Die anzufragende DNS-Klasse (standardmäßig IN)\n", " -h --help Diese Hilfe anzeigen\n", " -s --server Der abzufragende Server\n", " -t --type Der anzufragende Record-Typ (standardmäßig ALL,\n", " kann wiederholt werden)" ], "long_option_requires_argument": [ "%[prog]: Option --%[opt] benötigt ein Argument" ], "option_requires_argument": "%[prog]: Option -%[opt] benötigt ein Argument", "unknown_long_option": "%[prog]: Unbekannte Option: --%[opt]", "unknown_option": "%[prog]: Unbekannte Option: -%[opt]", "failed_to_resolve": "Auflösen fehlgeschlagen: %[exception]" } |