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

feat: short with value in same arg #69

Closed

Conversation

shadowspawn
Copy link
Collaborator

(This PR builds on #68 so the diff is currently noisy. To see the new code in the meantime look for isShortAndValue.)

Add support for combining an option and its value in the same argument. For example these are the same using the tail command:

tail -n 3 index.js 
tail -n3 index.js 

Or with parseArgs:

parseArgs(['-n', '3'], { withValue: ['n'] });
parseArgs(['-n3'], { withValue: ['n'] });

NB: this is the classic pattern with value directly following short and not the same pattern included in #62 which used -n=3. Which might prompt some discussion...

@shadowspawn
Copy link
Collaborator Author

Working on redo of this with new configuration bag of options.

@shadowspawn
Copy link
Collaborator Author

Redid work in #75 after #63 landed.

@shadowspawn shadowspawn closed this Mar 4, 2022
@shadowspawn shadowspawn deleted the feature/short-with-value-in-arg branch June 5, 2022 03:17
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.

1 participant