feat: introduce single-digit boolean aliases - #255
Merged
bcoe merged 2 commits intoMar 7, 2020
Conversation
As discussed on yargs/yargs#1454 even though there are plenty of valid usecases for single-digit aliases and many well stablished examples, it is still completely unsupported on yargs-parser. This changeset introduces the possibility of using this simple numeric alias in the context of boolean flags.
bcoe
approved these changes
Mar 7, 2020
bcoe
approved these changes
Mar 7, 2020
bcoe
left a comment
Member
There was a problem hiding this comment.
👍 this feature looks great to me @ruyadorno thanks for the contribution.
ruyadorno
added a commit
to ruyadorno/yargs
that referenced
this pull request
Mar 7, 2020
Add proper usage output for the now supported single-digit boolean aliases which landed in yargs-parser. ref: yargs/yargs-parser#255
This was referenced Mar 13, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following up from the discussion from: yargs/yargs#1454 even though there are plenty of valid usecases for single-digit aliases and many well stablished examples, it is still completely unsupported on yargs-parser.
As brought up by @benjie many standard unix tools uses such pattern, after reading his examples and giving it some thought, I ended up classifying them in two groups:
xargs -0kill -9gzip -1rsync -6git log -3grep -3This changeset introduces the support to the first group described, in which single-digits can be used as alias in the context of boolean flags.
/cc @bcoe @mleguen