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
Copy file name to clipboardExpand all lines: Readme.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,8 @@ const { program } = require('commander');
79
79
80
80
program
81
81
.option('--first')
82
-
.option('-s, --separator <char>');
82
+
.option('-s, --separator <char>')
83
+
.argument('<string>');
83
84
84
85
program.parse();
85
86
@@ -678,8 +679,7 @@ async function main() {
678
679
}
679
680
```
680
681
681
-
A command's options and arguments on the command line are validated when the command is used. Any unknown options or missing arguments will be reported as an error. You can suppress the unknown option checks with `.allowUnknownOption()`. By default, it is not an error to
682
-
pass more arguments than declared, but you can make this an error with `.allowExcessArguments(false)`.
682
+
A command's options and arguments on the command line are validated when the command is used. Any unknown options or missing arguments or excess arguments will be reported as an error. You can suppress the unknown option check with `.allowUnknownOption()`. You can suppress the excess arguments check with `.allowExcessArguments()`.
683
683
684
684
### Stand-alone executable (sub)commands
685
685
@@ -696,7 +696,7 @@ Example file: [pm](./examples/pm)
696
696
program
697
697
.name('pm')
698
698
.version('0.1.0')
699
-
.command('install [name]', 'install one or more packages')
699
+
.command('install [package-names...]', 'install one or more packages')
700
700
.command('search [query]', 'search with optional query')
0 commit comments