yargs 7.0.2-candidate.1 → 7.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,40 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ <a name="7.1.0"></a>
6
+ # [7.1.0](https://github.com/yargs/yargs/compare/v7.0.2...v7.1.0) (2017-04-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * fix demandOption no longer treats 'false' as truthy ([#829](https://github.com/yargs/yargs/issues/829)) ([c748dd2](https://github.com/yargs/yargs/commit/c748dd2))
12
+ * get terminalWidth in non interactive mode no longer causes a validation exception ([#837](https://github.com/yargs/yargs/issues/837)) ([360e301](https://github.com/yargs/yargs/commit/360e301))
13
+ * we shouldn't output help if we've printed a prior help-like message ([#847](https://github.com/yargs/yargs/issues/847)) ([17e89bd](https://github.com/yargs/yargs/commit/17e89bd))
14
+
15
+
16
+ ### Features
17
+
18
+ * add support for numeric commands ([#825](https://github.com/yargs/yargs/issues/825)) ([fde0564](https://github.com/yargs/yargs/commit/fde0564))
19
+
20
+
21
+
22
+ <a name="7.0.2"></a>
23
+ ### [7.1.2](https://www.github.com/yargs/yargs/compare/yargs-v7.1.1...yargs-v7.1.2) (2021-04-25)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * **deps:** explicitly bump yargs-parser ([#1887](https://www.github.com/yargs/yargs/issues/1887)) ([06db5fc](https://www.github.com/yargs/yargs/commit/06db5fcdbaf9a6150c0039acf210ed26af6e012f))
29
+
30
+ ## [7.0.2](https://github.com/yargs/yargs/compare/v7.0.1...v7.0.2) (2017-03-10)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * populating placeholder arguments broke validation ([b3eb2fe](https://github.com/yargs/yargs/commit/b3eb2fe))
36
+
37
+
38
+
5
39
  <a name="7.0.1"></a>
6
40
  ## [7.0.1](https://github.com/yargs/yargs/compare/v7.0.0...v7.0.1) (2017-03-03)
7
41
 
package/README.md CHANGED
@@ -10,7 +10,7 @@ With yargs, ye be havin' a map that leads straight to yer treasure! Treasure of
10
10
  [![NPM version][npm-image]][npm-url]
11
11
  [![Windows Tests][windows-image]][windows-url]
12
12
  [![js-standard-style][standard-image]][standard-url]
13
- [![standard-version][standard-version-image]][standard-version-url]
13
+ [![Conventional Commits][conventional-commits-image]][conventional-commits-url]
14
14
  [![Gitter][gitter-image]][gitter-url]
15
15
 
16
16
  > Yargs is the official successor to optimist. Please feel free to submit issues and pull requests. If you'd like to contribute and don't know where to start, have a look at [the issue list](https://github.com/yargs/yargs/issues) :)
@@ -2011,7 +2011,7 @@ This module is loosely inspired by Perl's
2011
2011
  [windows-image]: https://img.shields.io/appveyor/ci/bcoe/yargs-ljwvf/master.svg?label=Windows%20Tests
2012
2012
  [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
2013
2013
  [standard-url]: http://standardjs.com/
2014
- [standard-version-image]: https://img.shields.io/badge/release-standard%20version-brightgreen.svg
2015
- [standard-version-url]: https://github.com/conventional-changelog/standard-version
2014
+ [conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg
2015
+ [conventional-commits-url]: https://conventionalcommits.org/
2016
2016
  [gitter-image]: https://img.shields.io/gitter/room/nwjs/nw.js.svg?maxAge=2592000
2017
2017
  [gitter-url]: https://gitter.im/yargs/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yargs",
3
- "version": "7.0.2-candidate.1",
3
+ "version": "7.1.2",
4
4
  "description": "yargs the modern, pirate-themed, successor to optimist.",
5
5
  "main": "./index.js",
6
6
  "files": [
@@ -24,7 +24,7 @@
24
24
  "string-width": "^1.0.2",
25
25
  "which-module": "^1.0.0",
26
26
  "y18n": "^3.2.1",
27
- "yargs-parser": "^5.0.0"
27
+ "yargs-parser": "^5.0.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "chai": "^3.4.1",
package/yargs.js CHANGED
@@ -567,7 +567,7 @@ function Yargs (processArgs, cwd, parentRequire) {
567
567
  self.demand(key, demand)
568
568
  }
569
569
 
570
- if ('demandOption' in opt) {
570
+ if (opt.demandOption) {
571
571
  self.demandOption(key, typeof opt.demandOption === 'string' ? opt.demandOption : undefined)
572
572
  }
573
573
 
@@ -922,7 +922,7 @@ function Yargs (processArgs, cwd, parentRequire) {
922
922
 
923
923
  self.terminalWidth = function () {
924
924
  argsert([], 0)
925
- return process.stdout.columns
925
+ return typeof process.stdout.columns !== 'undefined' ? process.stdout.columns : null
926
926
  }
927
927
 
928
928
  Object.defineProperty(self, 'argv', {
@@ -983,7 +983,8 @@ function Yargs (processArgs, cwd, parentRequire) {
983
983
  var handlerKeys = command.getCommands()
984
984
  if (handlerKeys.length) {
985
985
  var firstUnknownCommand
986
- for (var i = 0, cmd; (cmd = argv._[i]) !== undefined; i++) {
986
+ for (var i = 0, cmd; argv._[i] !== undefined; i++) {
987
+ cmd = String(argv._[i])
987
988
  if (~handlerKeys.indexOf(cmd) && cmd !== completionCommand) {
988
989
  setPlaceholderKeys(argv)
989
990
  return command.runCommand(cmd, self, parsed)
@@ -1035,21 +1036,24 @@ function Yargs (processArgs, cwd, parentRequire) {
1035
1036
  }
1036
1037
 
1037
1038
  // Handle 'help' and 'version' options
1038
- Object.keys(argv).forEach(function (key) {
1039
- if (key === helpOpt && argv[key]) {
1040
- if (exitProcess) setBlocking(true)
1041
-
1042
- skipValidation = true
1043
- self.showHelp('log')
1044
- self.exit(0)
1045
- } else if (key === versionOpt && argv[key]) {
1046
- if (exitProcess) setBlocking(true)
1047
-
1048
- skipValidation = true
1049
- usage.showVersion()
1050
- self.exit(0)
1051
- }
1052
- })
1039
+ // if we haven't already output help!
1040
+ if (!hasOutput) {
1041
+ Object.keys(argv).forEach(function (key) {
1042
+ if (key === helpOpt && argv[key]) {
1043
+ if (exitProcess) setBlocking(true)
1044
+
1045
+ skipValidation = true
1046
+ self.showHelp('log')
1047
+ self.exit(0)
1048
+ } else if (key === versionOpt && argv[key]) {
1049
+ if (exitProcess) setBlocking(true)
1050
+
1051
+ skipValidation = true
1052
+ usage.showVersion()
1053
+ self.exit(0)
1054
+ }
1055
+ })
1056
+ }
1053
1057
 
1054
1058
  // Check if any of the options to skip validation were provided
1055
1059
  if (!skipValidation && options.skipValidation.length > 0) {