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
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -289,7 +289,7 @@ program
289
289
You use `.arguments` to specify the arguments for the top-level command, and for subcommands they are included in the `.command` call. Angled brackets (e.g. `<required>`) indicate required input. Square brackets (e.g. `[optional]`) indicate optional input.
290
290
291
291
```js
292
-
var program = require('commander');
292
+
const program = require('commander');
293
293
294
294
program
295
295
.version('0.1.0')
@@ -313,7 +313,7 @@ console.log('environment:', envValue || "no environment given");
313
313
append `...` to the argument name. For example:
314
314
315
315
```js
316
-
var program = require('commander');
316
+
const program = require('commander');
317
317
318
318
program
319
319
.version('0.1.0')
@@ -339,7 +339,7 @@ The action handler gets passed a parameter for each argument you declared, and o
339
339
command object itself. This command argument has the values for the command-specific options added as properties.
340
340
341
341
```js
342
-
var program = require('commander');
342
+
const program = require('commander');
343
343
344
344
program
345
345
.command('rm <dir>')
@@ -365,7 +365,7 @@ You handle the options for an executable (sub)command in the executable, and don
365
365
366
366
```js
367
367
// file: ./examples/pm
368
-
var program = require('commander');
368
+
const program = require('commander');
369
369
370
370
program
371
371
.version('0.1.0')
@@ -413,7 +413,7 @@ Options:
413
413
```js
414
414
#!/usr/bin/env node
415
415
416
-
var program = require('commander');
416
+
const program = require('commander');
417
417
418
418
program
419
419
.version('0.1.0')
@@ -478,8 +478,8 @@ Optional callback cb allows post-processing of help text before it is displayed.
478
478
If you want to display help by default (e.g. if no command was provided), you can use something like:
479
479
480
480
```js
481
-
var program = require('commander');
482
-
var colors = require('colors');
481
+
const program = require('commander');
482
+
const colors = require('colors');
483
483
484
484
program
485
485
.version('0.1.0')
@@ -557,7 +557,7 @@ the inspector port is incremented by 1 for the spawned subcommand.
557
557
## Examples
558
558
559
559
```js
560
-
var program = require('commander');
560
+
const program = require('commander');
561
561
562
562
program
563
563
.version('0.1.0')
@@ -570,7 +570,7 @@ program
570
570
.description('run setup commands for all envs')
571
571
.option("-s, --setup_mode [mode]", "Which setup mode to use")
572
572
.action(function(env, options){
573
-
var mode = options.setup_mode ||"normal";
573
+
const mode = options.setup_mode ||"normal";
574
574
env = env ||'all';
575
575
console.log('setup for %s env(s) with %s mode', env, mode);
0 commit comments