Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
- add commented out "normal" require
- add comment about local require
- remove low value "Module dependencies" comment
  • Loading branch information
shadowspawn committed Jan 2, 2020
1 parent d47fb0c commit 4922fb8
Show file tree
Hide file tree
Showing 21 changed files with 42 additions and 57 deletions.
7 changes: 2 additions & 5 deletions examples/custom-help
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env node

/**
* Module dependencies.
*/

var program = require('../');
// const program = require('commander'); // (normal include)
const program = require('../'); // include commander in git clone of commander repo

program
.version('0.0.1')
Expand Down
7 changes: 2 additions & 5 deletions examples/custom-help-description
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env node

/**
* Module dependencies.
*/

var program = require('../');
// const program = require('commander'); // (normal include)
const program = require('../'); // include commander in git clone of commander repo

program
.helpOption('-c, --HELP', 'custom help message')
Expand Down
7 changes: 2 additions & 5 deletions examples/custom-version
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env node

/**
* Module dependencies.
*/

var program = require('../');
// const program = require('commander'); // (normal include)
const program = require('../'); // include commander in git clone of commander repo

program
.version('0.0.1', '-v, --VERSION', 'new version message')
Expand Down
7 changes: 2 additions & 5 deletions examples/defaults
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env node

/**
* Module dependencies.
*/

var program = require('../');
// const program = require('commander'); // (normal include)
const program = require('../'); // include commander in git clone of commander repo

function list(val) {
return val.split(',').map(Number);
Expand Down
7 changes: 2 additions & 5 deletions examples/deploy
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env node

/**
* Module dependencies.
*/

var program = require('../');
// const program = require('commander'); // (normal include)
const program = require('../'); // include commander in git clone of commander repo

program
.version('0.0.1')
Expand Down
7 changes: 2 additions & 5 deletions examples/description
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env node

/**
* Module dependencies.
*/

var program = require('../');
// const program = require('commander'); // (normal include)
const program = require('../'); // include commander in git clone of commander repo

program
.version('0.0.1')
Expand Down
3 changes: 2 additions & 1 deletion examples/env
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node

var program = require('../');
// const program = require('commander'); // (normal include)
const program = require('../'); // include commander in git clone of commander repo

let cmdValue;
let envValue;
Expand Down
7 changes: 2 additions & 5 deletions examples/express
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env node

/**
* Module dependencies.
*/

var program = require('../');
// const program = require('commander'); // (normal include)
const program = require('../'); // include commander in git clone of commander repo

program
.version('0.0.1')
Expand Down
7 changes: 2 additions & 5 deletions examples/help
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env node

/**
* Module dependencies.
*/

var program = require('../');
// const program = require('commander'); // (normal include)
const program = require('../'); // include commander in git clone of commander repo

program
.version('0.0.1')
Expand Down
3 changes: 2 additions & 1 deletion examples/options-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
// pizza details:
// - cheese

const commander = require('../');
// const commander = require('commander'); // (normal include)
const commander = require('../'); // include commander in git clone of commander repo
const program = new commander.Command();

program
Expand Down
3 changes: 2 additions & 1 deletion examples/options-custom-processing.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
// $ custom --list x,y,z
// [ 'x', 'y', 'z' ]

const commander = require('../');
// const commander = require('commander'); // (normal include)
const commander = require('../'); // include commander in git clone of commander repo
const program = new commander.Command();

function myParseInt(value, dummyPrevious) {
Expand Down
3 changes: 2 additions & 1 deletion examples/options-defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
// $ pizza-options --cheese stilton
// cheese: stilton

const commander = require('../');
// const commander = require('commander'); // (normal include)
const commander = require('../'); // include commander in git clone of commander repo
const program = new commander.Command();

program
Expand Down
3 changes: 2 additions & 1 deletion examples/options-flag-or-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
// $ pizza-options --cheese mozzarella
// add cheese type mozzarella

const commander = require('../');
// const commander = require('commander'); // (normal include)
const commander = require('../'); // include commander in git clone of commander repo
const program = new commander.Command();

program
Expand Down
3 changes: 2 additions & 1 deletion examples/options-negatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
// $ pizza-options --no-sauce --no-cheese
// You ordered a pizza with no sauce and no cheese

const commander = require('../');
// const commander = require('commander'); // (normal include)
const commander = require('../'); // include commander in git clone of commander repo
const program = new commander.Command();

program
Expand Down
3 changes: 2 additions & 1 deletion examples/options-required.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
// $ pizza
// error: required option '-c, --cheese <type>' not specified

const commander = require('..'); // For running direct from git clone of commander repo
// const commander = require('commander'); // (normal include)
const commander = require('../'); // include commander in git clone of commander repo
const program = new commander.Command();

program
Expand Down
7 changes: 2 additions & 5 deletions examples/pizza
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#!/usr/bin/env node

/**
* Module dependencies.
*/

var program = require('../');
// const program = require('commander'); // (normal include)
const program = require('../'); // include commander in git clone of commander repo

program
.version('0.0.1')
Expand Down
3 changes: 2 additions & 1 deletion examples/pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node

var program = require('..');
// const program = require('commander'); // (normal include)
const program = require('../'); // include commander in git clone of commander repo

program
.version('0.0.1')
Expand Down
3 changes: 2 additions & 1 deletion examples/pm-install
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node

var program = require('..');
// const program = require('commander'); // (normal include)
const program = require('../'); // include commander in git clone of commander repo

program
.option('-f, --force', 'force installation')
Expand Down
3 changes: 2 additions & 1 deletion examples/storeOptionsAsProperties-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
// jump
// foo

const commander = require('../');
// const commander = require('commander'); // (normal include)
const commander = require('../'); // include commander in git clone of commander repo
const program = new commander.Command();

program
Expand Down
3 changes: 2 additions & 1 deletion examples/storeOptionsAsProperties-opts.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
// jump
// foo

const commander = require('../');
// const commander = require('commander'); // (normal include)
const commander = require('../'); // include commander in git clone of commander repo
const program = new commander.Command();

program
Expand Down
3 changes: 2 additions & 1 deletion examples/storeOptionsAsProperties-problem.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
// jump
// foo

const commander = require('../');
// const commander = require('commander'); // (normal include)
const commander = require('../'); // include commander in git clone of commander repo
const program = new commander.Command();

program
Expand Down

0 comments on commit 4922fb8

Please sign in to comment.