| 33 | } |
| 34 | |
| 35 | printUsageAndExit() { |
| 36 | console.log('Cmdline args: [options] [log-file-name]\n' + |
| 37 | 'Default log file name is "' + |
| 38 | this.result_.logFileName + '".\n'); |
| 39 | console.log('Options:'); |
| 40 | for (const arg in this.argsDispatch_) { |
| 41 | const synonyms = [arg]; |
| 42 | const dispatch = this.argsDispatch_[arg]; |
| 43 | for (const synArg in this.argsDispatch_) { |
| 44 | if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) { |
| 45 | synonyms.push(synArg); |
| 46 | delete this.argsDispatch_[synArg]; |
| 47 | } |
| 48 | } |
| 49 | console.log(` ${synonyms.join(', ').padEnd(20)} ${dispatch[2]}`); |
| 50 | } |
| 51 | quit(2); |
| 52 | } |
| 53 | |
| 54 | parse() { |
| 55 | while (this.args_.length) { |