Remove short-flags in `cli.flags` if they're defined as `alias`
See original GitHub issueconst cli = m({
argv: ['-c', '-l'],
flags: {
coco: {
alias: 'c'
},
loco: {
alias: 'l'
}
}
});
console.log(cli.flags);
//=> { c: true, coco: true, l: true, loco: true }
Since c
and l
are defined as alias
for two other flags, I think we should just exclude the short-flags from the cli.flags
output. They just create noise there.
So it would be this instead:
console.log(cli.flags);
//=> { coco: true, loco: true }
Thoughts?
picchikevin earned $40.00 by resolving this issue!
- Checkout the Issuehunt explorer to discover more funded issues.
- Need some help from other developers? Add your repositories on Issuehunt to raise funds.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Passing flags to a command inside an alias - linux - Super User
I have created an alias for ls in order to let it print out a format that I like. I have defined the...
Read more >Clarify description of --alias flag for deploy command #1984
We got some docs-related feedback about the --alias flag for the deploy command. The alias flag was renamed to from the branch flag,...
Read more >Linux alias Command: How to Use It With Examples
In this tutorial, learn how to create, view, and remove temporary and permanent command shortcuts in Linux using the alias command.
Read more >Command-line syntax overview for System.CommandLine
An introduction to the command-line syntax that the System.CommandLine library recognizes by default. Mentions exceptions where syntax in ...
Read more >Using Cobra and Go to Create Command Line Utilities - Linode
Cobra is a popular Go package that lets you develop command line ... for command line flags; A command line utility with command...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
hi all, around 10 meow dependent CLI’s of mine were dependent on aliases. I’ve been using
if (cli.flags.z)
all over the code for convenience. What was done was done, v6 is out and I had to fix bunch of CLI’s but in the future please don’t remove issues if they already exist and don’t block anything.Convenience for you, but worse readability for anyone else reading your code. The change was done exactly to fix code like yours.
I cannot promise that. If something will help people improve their CLIs or code, I’ll do it.