Parse Aliases
See original GitHub issueI know that now to parse need use aliases package (related #24).
One of my projects consists of scripts (about a hundred) to run in Continuous Integration.
I have to add the same lines in each file.
const aliases = require('aliases');
meow(help, { alias: aliases(help, {h: 'help'}) });
I think that we can add parseAliases
option to simplify API.
const help = `
Usage
$ unicorn <name>
Options
-r, --rainbow Lorem ipsum dolor sit amet
-m, --magic Aenean commodo ligula eget dolor
`;
meow(help, { parseAliases: true });
I’d really like to have this feature by default.
We can parse aliases if alias
option is not specified. It won’t break backward compatibility.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:11
- Comments:9 (6 by maintainers)
Top Results From Across the Web
sindresorhus/aliases: Parse flag aliases in CLI help output
import aliases from 'aliases'; const help = ` Usage $ unicorn <name> Options -r, --rainbow Lorem ipsum dolor sit amet -m, --magic Aenean...
Read more >Failed to parse aliases - Common causes and quick fixes
A detailed guide on how to resolve errors related to "Failed to parse aliases"
Read more >When to resolve aliases while parsing? - java
I want to give the user an option to define custom aliases like alias com='command2 | command3' (bash style). Then the user should...
Read more >Parse argument aliases in Deno
Using Deno's standard flags module to parse command-line arguments with aliases.
Read more >Why are queries parsed in such a way that disallows ...
The MSDN docs say that the general logical parsing order is such that SELECT is parsed nearly last (thus resulting in "no such...
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
I’ve come to the realization that it would be better to go the other way around. Generate CLI output from code definition. So closing this.
Basic usability of the
meow
is that I can write help in human-readable format and do nothing more. Based on this philosophy need to parse not only arguments but also aliases.I have invited several developers to use
meow
. Each of them asked me, “Why do we need to describe aliases twice?”.