You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -180,7 +180,7 @@ Multi-word options such as "--template-engine" are camel-cased, becoming `progra
180
180
181
181
An option and its option-argument can be separated by a space, or combined into the same argument. The option-argument can follow the short option directly or follow an `=` for a long option.
182
182
183
-
```bash
183
+
```sh
184
184
serve -p 80
185
185
serve -p80
186
186
serve --port 80
@@ -219,7 +219,7 @@ if (options.small) console.log('- small pizza size');
219
219
if (options.pizzaType) console.log(`- ${options.pizzaType}`);
@@ -387,7 +387,7 @@ The optional `version` method adds handling for displaying the command version.
387
387
program.version('0.0.1');
388
388
```
389
389
390
-
```bash
390
+
```console
391
391
$ ./examples/pizza -V
392
392
0.0.1
393
393
```
@@ -404,7 +404,7 @@ program.version('0.0.1', '-v, --vers', 'output the current version');
404
404
You can add most options using the `.option()` method, but there are some additional features available
405
405
by constructing an `Option` explicitly for less common cases.
406
406
407
-
Example files: [options-extra.js](./examples/options-extra.js), [options-env.js](./examples/options-env.js), [options-conflicts.js](./examples/options-conflicts.js)
407
+
Example files: [options-extra.js](./examples/options-extra.js), [options-env.js](./examples/options-env.js), [options-conflicts.js](./examples/options-conflicts.js), [options-implies.js](./examples/options-implies.js)
error: option '--disable-server' cannot be used with option '-p, --port <number>'
@@ -489,7 +491,7 @@ if (options.collect.length > 0) console.log(options.collect);
489
491
if (options.list!==undefined) console.log(options.list);
490
492
```
491
493
492
-
```bash
494
+
```console
493
495
$ custom -f 1e2
494
496
float: 100
495
497
$ custom --integer 2
@@ -728,7 +730,7 @@ help option is `-h,--help`.
728
730
729
731
Example file: [pizza](./examples/pizza)
730
732
731
-
```bash
733
+
```console
732
734
$ node ./examples/pizza --help
733
735
Usage: pizza [options]
734
736
@@ -744,7 +746,7 @@ Options:
744
746
A `help` command is added by default if your command has subcommands. It can be used alone, or with a subcommand name to show
745
747
further help for the subcommand. These are effectively the same if the `shell` program has implicit help:
746
748
747
-
```bash
749
+
```sh
748
750
shell help
749
751
shell --help
750
752
@@ -806,7 +808,7 @@ program.showHelpAfterError();
806
808
program.showHelpAfterError('(add --help for additional information)');
807
809
```
808
810
809
-
```sh
811
+
```console
810
812
$ pizza --unknown
811
813
error: unknown option '--unknown'
812
814
(add --help for additional information)
@@ -818,7 +820,7 @@ You can also show suggestions after an error for an unknown command or option.
818
820
program.showSuggestionAfterError();
819
821
```
820
822
821
-
```sh
823
+
```console
822
824
$ pizza --hepl
823
825
error: unknown option '--hepl'
824
826
(Did you mean --help?)
@@ -991,7 +993,7 @@ program
991
993
992
994
If you use `ts-node` and stand-alone executable subcommands written as `.ts` files, you need to call your program through node to get the subcommands called correctly. e.g.
0 commit comments