Skip to content

Instantly share code, notes, and snippets.

@BinaryMuse
Created January 24, 2020 23:58
Show Gist options
  • Save BinaryMuse/bbb9bdb6f3c4658838792fb44926b8f2 to your computer and use it in GitHub Desktop.
Save BinaryMuse/bbb9bdb6f3c4658838792fb44926b8f2 to your computer and use it in GitHub Desktop.
import { Cli, Command } from 'clipanion'
class CommandHelp extends Command {
@Command.Path()
@Command.Path('--help')
@Command.Path('-h')
async execute() {
this.context.stdout.write(this.cli.usage(null))
}
}
const cli = Cli.from([
CommandHelp
])
cli.runExit(process.argv.slice(2), {
stdin: process.stdin,
stdout: process.stdout,
stderr: process.stderr,
})
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment