Skip to content

Commit

Permalink
docs: remove demand examples (#772)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrimue authored and Benjamin Coe committed Feb 18, 2017
1 parent f096e9c commit 3d0490c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -1081,12 +1081,12 @@ require('yargs')
'run': {
alias: 'r',
describe: 'run your program',
demand: true
demandOption: true
},
'path': {
alias: 'p',
describe: 'provide a path to file',
demand: true
demandOption: true
},
'spec': {
alias: 's',
Expand Down Expand Up @@ -1412,7 +1412,7 @@ var argv = require('yargs')
.option('option', {
alias: 'o',
describe: "'tis a mighty fine option",
demand: true
demandOption: true
})
.command('run', "Arrr, ya best be knowin' what yer doin'")
.example('$0 run foo', "shiver me timbers, here's an example for ye")
Expand Down Expand Up @@ -1529,7 +1529,7 @@ For example:
var argv = require('yargs')
.option('f', {
alias: 'file',
demand: true,
demandOption: true,
default: '/etc/passwd',
describe: 'x marks the spot',
type: 'string'
Expand Down Expand Up @@ -1558,7 +1558,7 @@ var argv = require('yargs')
.options({
'f': {
alias: 'file',
demand: true,
demandOption: true,
default: '/etc/passwd',
describe: 'x marks the spot',
type: 'string'
Expand Down
1 change: 1 addition & 0 deletions yargs.js
Expand Up @@ -552,6 +552,7 @@ function Yargs (processArgs, cwd, parentRequire) {

var demand = opt.demand || opt.required || opt.require

// deprecated, use 'demandOption' instead
if (demand) {
self.demand(key, demand)
}
Expand Down

0 comments on commit 3d0490c

Please sign in to comment.