napi-rs/cli/src/commands/help.ts
forehal a781a4f27e feat(cli): brand new cli tool with both cli and programmatical usage (#1492)
BREAKING CHANGE: requires node >= 16 and some cli options have been renamed
2023-04-06 11:04:53 +08:00

13 lines
291 B
TypeScript

import { Command } from 'clipanion'
/**
* A command that prints the usage of all commands.
*
* Paths: `-h`, `--help`
*/
export class HelpCommand extends Command<any> {
static paths = [[`-h`], [`--help`]]
async execute() {
await this.context.stdout.write(this.cli.usage())
}
}