Skip to content

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