yargs 10.1.1 → 10.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 +10 -0
- package/lib/validation.js +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
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="10.1.2"></a>
|
|
6
|
+
## [10.1.2](https://github.com/yargs/yargs/compare/v10.1.1...v10.1.2) (2018-01-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* requiresArg should only be enforced if argument exists ([#1043](https://github.com/yargs/yargs/issues/1043)) ([fbf41ae](https://github.com/yargs/yargs/commit/fbf41ae))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
5
15
|
<a name="10.1.1"></a>
|
|
6
16
|
## [10.1.1](https://github.com/yargs/yargs/compare/v10.1.0...v10.1.1) (2018-01-09)
|
|
7
17
|
|
package/lib/validation.js
CHANGED
|
@@ -59,13 +59,15 @@ module.exports = function validation (yargs, usage, y18n) {
|
|
|
59
59
|
self.missingArgumentValue = function missingArgumentValue (argv) {
|
|
60
60
|
const defaultValues = [true, false, '', undefined]
|
|
61
61
|
const options = yargs.getOptions()
|
|
62
|
-
|
|
63
62
|
if (options.requiresArg.length > 0) {
|
|
64
63
|
const missingRequiredArgs = []
|
|
65
64
|
|
|
66
65
|
options.requiresArg.forEach((key) => {
|
|
67
|
-
|
|
66
|
+
// if the argument is not set in argv no need to check
|
|
67
|
+
// whether a right-hand-side has been provided.
|
|
68
|
+
if (!argv.hasOwnProperty(key)) return
|
|
68
69
|
|
|
70
|
+
const value = argv[key]
|
|
69
71
|
// if a value is explicitly requested,
|
|
70
72
|
// flag argument as missing if it does not
|
|
71
73
|
// look like foo=bar was entered.
|