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

Examples all use special case of repeated option #14

Closed
shadowspawn opened this issue Nov 14, 2021 · 2 comments
Closed

Examples all use special case of repeated option #14

shadowspawn opened this issue Nov 14, 2021 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@shadowspawn
Copy link
Collaborator

The examples all use a special case of a repeated option in the command line: https://github.com/pkgjs/parseargs#-examples-w-output

const argv = ['-f', '--foo=a', '--foo', 'b']

I suggest a repeated option should be in a separate example and not occur in examples showing other behaviours.

It is clever seeing the behaviour change for a single command-line as the parseArgs configuration is changed, but I think it detracts from the clarity of the examples of (other) specific behaviours.

(In particular the reader has to deduce or understand the behaviour of a repeated option in every example. Repeated options have multiple possible implementations, and parseArg behaviour was modified from count to last-one-wins due to feedback in the Initial Proposal, with implicit array also being suggested and discussed!)

@bcoe bcoe added the documentation Improvements or additions to documentation label Nov 14, 2021
@bcoe
Copy link
Collaborator

bcoe commented Nov 14, 2021

@shadowspawn I agree with this feedback 👍 want to send a patch?

@shadowspawn
Copy link
Collaborator Author

Fixed by #23

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

No branches or pull requests

2 participants