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

Make commandline parameters case insensitive #158

Closed
wants to merge 2 commits into from

Conversation

mcon
Copy link
Contributor

@mcon mcon commented Nov 19, 2020

Addresses #155 - whether or not this is strictly necessary or not is up for debate: personally I prefer --kebab-case parameters, though for those that use --CamelCase this would save adding a whole load of annotations.

Will happily amend the documentation and provide an example if this is considered a desirable change.

if argInfo.CliParamIndex.Value.TryGetPrefix(token, &prefix, &case) then
if token = prefix then CliParam(token, prefix, case, NoAssignment) |> kont
if argInfo.CliParamIndex.Value.TryGetCaseInsensitivePrefix(token, &prefix, &case) then
if token.ToLower() = prefix.ToLower() then CliParam(token, prefix, case, NoAssignment) |> kont
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String.Equals(token, prefix, StringComparison.OrdinalIgnoreCase)

@eiriktsarpalis
Copy link
Member

Thanks, but I'm not sure I'm a fan of that particular change. I would prefer it if the library steered people towards adopting POSIX conventions for argument syntax:

GNU adds long options to these conventions. Long options consist of ‘--’ followed by a name made of alphanumeric characters and dashes. Option names are typically one to three words long, with hyphens to separate words. Users can abbreviate the option names as long as the abbreviations are unique.

Allowing camelCase should therefore not be supported by design.

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

Successfully merging this pull request may close these issues.

3 participants