Closed vagusX closed 4 years ago
class GreetCommand extends Command { @Command.Boolean(`-v,--verbose`) public verbose: boolean = false; @Command.String(`-n,--name`) public name?: string; @Command.Path(`greet`) async execute() { if (typeof this.name === `undefined`) { this.context.stdout.write(`You're not registered.\n`); } else { this.context.stdout.write(`Hello, ${this.name}!\n`); } } }
Works like this: bin greet -n=123 and bin greet --name 123 Cannot work like this: bin greet --name=123
bin greet -n=123
bin greet --name 123
bin greet --name=123
Are you sure? It's covered by tests:
https://github.com/arcanis/clipanion/blob/master/tests/core.test.ts#L373
Works like this:
bin greet -n=123
andbin greet --name 123
Cannot work like this:bin greet --name=123