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

Allow nameMapper to disable default name #104

Open
lihaoyi opened this issue Jan 26, 2024 · 0 comments
Open

Allow nameMapper to disable default name #104

lihaoyi opened this issue Jan 26, 2024 · 0 comments

Comments

@lihaoyi
Copy link
Member

lihaoyi commented Jan 26, 2024

Currently, nameMapper: String => Option[String] only optionally adds an additional name that you can refer to a main method or argument, but it cannot remove the original name. The only way to remove the original name is by using an explicit name = "".

We should change the signature to nameMapper: String => Seq[String], where nameMapper returns all names that are allowed: nullNameMapper would return only the original name, kebabCaseNameMapper and snakeCaseNameMapper would return both the original name and the mapped name, and we would also be able to introduce kebabCaseOnlyNameMapper and snakeCaseOnlyNameMapper that return the mapped name without the original name

The original un-mapped name doesn't show up in the --help message and is mostly for backwards compatibility. This is probably not a big deal, but it would be nice if users who do not want the backwards compatibility shim to be able to opt out of it

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

1 participant