Skip to content
Myr

Combine custom version flags and description in README

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by John Gee · committed by John Gee · parent afb8156 · Browse files · 1 file+4 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−11 removed

  • other:+4 added−11 removed

1 file+4 added−11 removed

modified:Readme.md+4 added-11 removed
205 unmodified lines
206```207208### Version option209210The optional `version` method adds handling for displaying the command version. The default option flags are `-V` and `--version`, and when present the command prints the version number and exits.210The optional `version` method adds handling for displaying the command version. The default option flags are `-V` and `--version`, and when present the command prints the version number and exits.211212```js213 program.version('0.0.1');214```
2 unmodified lines
217 $ ./examples/pizza -V218 0.0.1219```220221You may specify custom flags by passing an additional parameter to the `version` method using the same syntax as the `option` method. The version flags can be named anything, but a long name is required.221You may change the flags and description by passing additional parameters to the `version` method, using222the same syntax for flags as the `option` method. The version flags can be named anything, but a long name is required.223224```js224program.version('0.0.1', '-v, --version');225program.version('0.0.1', '-v, --vers', 'output the current version');226```227227You can also override the help description for the version command.228229```js230program.version('0.0.1', '-v, --version', 'output the current version');231```232233234228## Command-specific options229230You can attach options to a command.231
300 unmodified lines