Skip to content
Myr

Merge pull request #55 from despekiroule/version

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Issue #48 : Take -version from package.json

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parents f4fd782, 3118871 · Browse files · 2 files+26 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+26 added−1 removed

  • tests:+19 added−0 removed
  • other:+7 added−1 removed

2 files+26 added−1 removed

modified:lib/commander.js+7 added-1 removed
339 unmodified lines
340 this.rawArgs = argv;341342 // guess name343 if (!this.name) this.name = basename(argv[1]);344344 // guess version345 if (!this._version) {346 try {347 this.version(require('../package.json').version);348 } catch(e) {}349 }350 // process argv351 var parsed = this.parseOptions(this.normalize(argv.slice(2)));352 this.args = parsed.args;353 return this.parseArgs(this.args, parsed.unknown);
205 unmodified lines
559 console.error();560 process.exit(1);561};562563564/**565 * Set the program version to `str`.566 *567 * This method auto-registers the "-V, --version" flag
464 unmodified lines
added:test/test.packagejsonversion.js+19 added