arcanis / clipanion

Type-safe CLI library / framework with no runtime dependencies
https://mael.dev/clipanion/
1.12k stars 66 forks source link

cannot work with --name=123 #22

Closed vagusX closed 4 years ago

vagusX commented 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

arcanis commented 4 years ago

Are you sure? It's covered by tests:

https://github.com/arcanis/clipanion/blob/master/tests/core.test.ts#L373