dthree / dthree/vorpal

How to offer options that are applicable to all commands?

Open
#323 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.6k
Forks
278
PR merge metrics
No merged PRs in 30d

Description

I'd like to offer options that are applicable to all commands. For instance, at a minimum, I'd like to do be able to do:

``` javascript
const vorpal = require('vorpal')()

vorpal
.option('-o, --out ')
.option('-c, --config ')
.option('-e, --env ')
.option('-d, --debug [logLevel]')
.option('-g, --global')
.option('-f, --force')
.option('--no-color')
.option('--silent')
.option('--skeleton ')
.option('--offline')

vorpal.parse(process.argv)

// do something with the options

// add the commands

vorpal.show()
```

Then I'd like to add the commands on later.

The use case here, is the ability to setup my application using the global configuration, then once the application is ready for input, and once all the apps plugins has extended vorpal with their own commands, then do the commands.

The application in question is [docpad](https://github.com/docpad/docpad).

/cc https://github.com/docpad/docpad/issues/1048

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.