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

[Design] Are multiple option tokens supported for single value options (last one wins)? #2398

Open
KathleenDollard opened this issue Apr 23, 2024 · 1 comment
Labels
Design Powderhouse Work to isolate parser and features

Comments

@KathleenDollard
Copy link
Contributor

No description provided.

@KalleOlaviNiemitalo
Copy link

KalleOlaviNiemitalo commented Apr 23, 2024

FWIW, if you call a function in Common Lisp and provide duplicate keyword arguments, then the first one wins. But I suppose this is for convenience with &REST and APPLY, which expands only the last argument as a list. In command-line scripting, PowerShell splatting and POSIX sh "$@" are similar features but they can be used at the start of the command line as well.

For command lines, I worry that allowing later options to override earlier ones by default may make it difficult for the application developer to convert the single-value option to a multiple-value option in a later version, without breaking compatibility. But I suppose such conversion is not common and, if the developer intends to do it later, they can make it a multiple-value option right at the start and validate that it has only one value. Although this would still allow completion to suggest additional values…? Oh right, ArgumentArity is better for this than a validator, as it can be recognized by the completion engine.

@KathleenDollard KathleenDollard changed the title [Design] Are multiple option tokens are supported for single value options (last one wins)? [Design] Are multiple option tokens supported for single value options (last one wins)? May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Powderhouse Work to isolate parser and features
Projects
None yet
Development

No branches or pull requests

2 participants