Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0 roadmap #2

Closed
egoist opened this issue Feb 4, 2017 · 0 comments
Closed

4.0 roadmap #2

egoist opened this issue Feb 4, 2017 · 0 comments

Comments

@egoist
Copy link
Collaborator

egoist commented Feb 4, 2017

cac is going to be like commander.js more while keeping the good part of minimist.

Require

const cac = require('cac')
const cli = cac()
// ...
cli.parse()

Command

// cli.js
cli.command('init', 'description', (input, flags) => {})
// or omit the handler function to use an external file
cli.command('init', 'description')
// then we get the handler function by `require('./cli-init')`

Option

// cli.js
cli.option('w, watch', 'description')
// this will be included i top-level command's help
// eg: `node cli.js --help`

cli.option('w, watch', 'description', {command: 'init'})
// this will be included in subcommand `init`'s help
// eg: `node cli.js init --help`
@egoist egoist closed this as completed Jun 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant