(args: string[] = process.argv.slice(2), options: { commandName?: string } = {})
| 101 | } |
| 102 | |
| 103 | export async function runUsageCommand(args: string[] = process.argv.slice(2), options: { commandName?: string } = {}): Promise<void> { |
| 104 | const commandName = options.commandName || "npm run usage"; |
| 105 | if (args.length > 0 && (args[0] === "--help" || args[0] === "-h" || args[0] === "help")) { |
| 106 | printUsage(commandName); |
| 107 | return; |
| 108 | } |
| 109 | await showUsageReport(); |
| 110 | } |
| 111 | |
| 112 | if (require.main === module) { |
| 113 | void runUsageCommand().catch((error: any) => { |
no test coverage detected