Closed LiteracyFanatic closed 3 years ago
Related to https://github.com/fsprojects/Argu/pull/158#issuecomment-731216799. I think fundamentally this is a breaking change so I wouldn't support it. Is there a way disable the linter for the particular source file?
I completely agree regarding #158; the generated options should follow standard conventions. I would just like it if these two snippets both parsed to --no-open
.
type ReadArgs =
| Title of string
| Last
| Port of int
| No_Open // --no-open
type ReadArgs =
| Title of string
| Last
| Port of int
| NoOpen // --noopen
It is technically a breaking change though and as you mentioned I can disable the lint rule, so I understand your preference to leave things as is.
Description
Union names in F# are typically written in pascal case rather than snake case. Right now I have to add underscores to my union names if I want dashes to appear between words in the generated command line options. This isn't a huge deal by any means, but it does make the linter in my editor angry.
A regex like this is all that would be needed
The only real issue I can think of is the question of how it would interact with the current underscore splitting behavior. I think it would make sense to let the existing behavior take precedence and only split on capital letters if the name contains no underscores.
If this sounds like a reasonable change to you, I'd be glad to open a pull request.