Comparing version 4.2.3 to 4.2.4
@@ -404,2 +404,4 @@ 'use strict'; | ||
} | ||
this.emit('executed', command, input, flags); | ||
} | ||
@@ -406,0 +408,0 @@ |
{ | ||
"name": "cac", | ||
"version": "4.2.3", | ||
"version": "4.2.4", | ||
"description": "Command-line queen.", | ||
@@ -5,0 +5,0 @@ "repository": { |
<img width="945" alt="2017-07-26 9 27 05" src="https://user-images.githubusercontent.com/8784712/28623641-373450f4-7249-11e7-854d-1b076dab274d.png"> | ||
[![NPM version](https://img.shields.io/npm/v/cac.svg?style=flat)](https://npmjs.com/package/cac) [![NPM downloads](https://img.shields.io/npm/dm/cac.svg?style=flat)](https://npmjs.com/package/cac) [![CircleCI](https://circleci.com/gh/egoist/cac/tree/master.svg?style=shield)](https://circleci.com/gh/egoist/cac/tree/master) [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](https://github.com/egoist/donate) [![chat](https://img.shields.io/badge/chat-on%20discord-7289DA.svg?style=flat)](https://chat.egoist.moe) | ||
[![NPM version](https://img.shields.io/npm/v/cac.svg?style=flat)](https://npmjs.com/package/cac) [![NPM downloads](https://img.shields.io/npm/dm/cac.svg?style=flat)](https://npmjs.com/package/cac) [![CircleCI](https://circleci.com/gh/cacjs/cac/tree/master.svg?style=shield)](https://circleci.com/gh/cacjs/cac/tree/master) [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](https://github.com/egoist/donate) [![chat](https://img.shields.io/badge/chat-on%20discord-7289DA.svg?style=flat)](https://chat.egoist.moe) | ||
@@ -35,2 +35,3 @@ ## Introduction | ||
+ [parsed](#parsed) | ||
- [Plugins](#plugins) | ||
- [FAQ](#faq) | ||
@@ -208,10 +209,28 @@ * [Why not `commander.js` `yargs` `caporal.js` or `meow`?](#why-not-commanderjs-yargs-caporaljs-or-meow) | ||
#### executed | ||
Emit after CAC executed commands or outputed help / version number: | ||
```js | ||
cli.on('executed', (command, input, flags) => { | ||
// command might be undefined | ||
}) | ||
``` | ||
## Plugins | ||
- [required-option](https://github.com/cacjs/required-option) - Mark an option as required for specific command. | ||
## FAQ | ||
### Why not `commander.js` `yargs` `caporal.js` or `meow`? | ||
### Why not `commander.js` `yargs` `caporal.js` or `meow` ? | ||
Commander.js and Caporal.js do not allow unknown options, Commander.js does not support [chaining option](https://github.com/tj/commander.js/issues/606). | ||
`CAC` is simpler and less opinionated comparing to `commander.js` `yargs` `caporal.js`. | ||
Commander.js does not support [chaining option](https://github.com/tj/commander.js/issues/606) which is a feature I like a lot. It's not really actively maintained at the time of writing either. | ||
Yargs has a powerful API, but it's so massive that my brain trembles. Meow is simple and elegant but I have to manully construct the *help* message, which will be annoying. And I want it to support *sub-command* too. | ||
And none of them are pluggable. | ||
**So why creating a new thing instead of pull request?** | ||
@@ -245,4 +264,4 @@ | ||
**cac** © [egoist](https://github.com/egoist), Released under the [MIT](./LICENSE) License.<br> | ||
Authored and maintained by egoist with help from contributors ([list](https://github.com/egoist/cac/contributors)). | ||
Authored and maintained by egoist with help from contributors ([list](https://github.com/cacjs/cac/contributors)). | ||
> [egoist.moe](https://egoist.moe) · GitHub [@egoist](https://github.com/egoist) · Twitter [@_egoistlily](https://twitter.com/_egoistlily) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20197
347
265