aliases
v2.0.0
Published
Parse flag aliases in CLI help output
Downloads
132
Maintainers
Readme
aliases
Parse flag aliases in CLI help output
Install
$ npm install aliases
Usage
import aliases from 'aliases';
const help = `
Usage
$ unicorn <name>
Options
-r, --rainbow Lorem ipsum dolor sit amet
-m, --magic Aenean commodo ligula eget dolor
`;
aliases(help, {h: 'help'});
/*
{
r: 'rainbow',
m: 'magic',
h: 'help'
}
*/
The result can be passed directly to the minimist alias
option or used in meow with some effort.
API
aliases(input, extras?)
input
Type: string
CLI help output.
extras
Type: object
Extra aliases to mix into the result.
Related
- parse-help - Parse CLI help output