Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mixedCase params are not recognized when passed as paramName=value #145

Open
jakub-g opened this issue Jun 16, 2023 · 3 comments
Open

mixedCase params are not recognized when passed as paramName=value #145

jakub-g opened this issue Jun 16, 2023 · 3 comments

Comments

@jakub-g
Copy link
Contributor

jakub-g commented Jun 16, 2023

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.

@jakub-g jakub-g changed the title mixedCase params are not recognized when passed as param=value mixedCase params are not recognized when passed as paramName=value Jun 16, 2023
@jakub-g
Copy link
Contributor Author

jakub-g commented Jun 16, 2023

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.

@jakub-g
Copy link
Contributor Author

jakub-g commented Jun 16, 2023

Looks like when using {required:true} then clipanion doesn't like mixedCase at all.

@arcanis
Copy link
Owner

arcanis commented Jun 16, 2023

I think it's a duplicate of #141 - wan't to try PR'ing a fix? 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants