clipanion
clipanion copied to clipboard
mixedCase params are not recognized when passed as `paramName=value`
import { Command, Option } from 'clipanion';
class MixedCaseTest extends Command {
static paths = [['mixed-case-test']];
mixedParam = Option.String('--mixedParam');
async execute() {
console.log('ok');
}
}
export default [MixedCaseTest]
Using 3.2.0-rc.14
$ yarn cli mixed-case-test --mixedParam abc
ok
$ yarn cli mixed-case-test --mixedParam=abc
Unknown Syntax Error: Invalid option name ("--mixedParam=abc").
yarn cli mixed-case-test [--mixedParam #0]
If param name is --lower then --lower=value and --lower value both work.
The same applies to numbers in the param names
param = Option.String('--k8s-name');
async execute() {
console.log(this.param);
}
Using --k8s-name abc it prints abc but using --k8s-name=abc it throws.
Looks like when using {required:true} then clipanion doesn't like mixedCase at all.
I think it's a duplicate of #141 - wan't to try PR'ing a fix? 😁