(options: Option[])
| 216 | } |
| 217 | |
| 218 | function partitionOptions(options: Option[]): { |
| 219 | flags: Option[]; |
| 220 | valueOptions: Option[]; |
| 221 | } { |
| 222 | const flags: Option[] = []; |
| 223 | const valueOptions: Option[] = []; |
| 224 | |
| 225 | options.forEach((option) => { |
| 226 | if (option.hidden) { |
| 227 | return; |
| 228 | } |
| 229 | |
| 230 | if (option.required || option.optional) { |
| 231 | valueOptions.push(option); |
| 232 | } else { |
| 233 | flags.push(option); |
| 234 | } |
| 235 | }); |
| 236 | |
| 237 | return { flags, valueOptions }; |
| 238 | } |
| 239 | |
| 240 | function buildUsage(command: Command): string { |
| 241 | return command.createHelp().commandUsage(command).trim(); |
no test coverage detected
searching dependent graphs…