Skip to content

Commit 6ca85cd

Browse files
author
Benjamin E. Coe
authored
nits: a couple small tweaks while merging upstream (#117)
* small tweak to wording for greedy args (thought it read clearer). * received warning from linter for capital Object in JSDoc.
1 parent c2b5e72 commit 6ca85cd

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function checkOptionLikeValue(longOption, optionValue, shortOrLong, strict) {
9494
`'--${longOption}=-XYZ'`;
9595
const errorMessage = `Option '${shortOrLong}' argument is ambiguous.
9696
Did you forget to specify the option argument for '${shortOrLong}'?
97-
Or to specify an option argument starting with a dash use ${example}.`;
97+
To specify an option argument starting with a dash use ${example}.`;
9898
throw new ERR_PARSE_ARGS_INVALID_OPTION_VALUE(errorMessage);
9999
}
100100
}
@@ -104,7 +104,7 @@ Or to specify an option argument starting with a dash use ${example}.`;
104104
*
105105
* @param {string} longOption - long option name e.g. 'foo'
106106
* @param {string|undefined} optionValue - value from user args
107-
* @param {Object} options - option configs, from parseArgs({ options })
107+
* @param {object} options - option configs, from parseArgs({ options })
108108
* @param {string} shortOrLong - option used, with dashes e.g. `-l` or `--long`
109109
* @param {boolean} strict - show errors, from parseArgs({ strict })
110110
*/
@@ -134,8 +134,8 @@ function checkOptionUsage(longOption, optionValue, options,
134134
*
135135
* @param {string} longOption - long option name e.g. 'foo'
136136
* @param {string|undefined} optionValue - value from user args
137-
* @param {Object} options - option configs, from parseArgs({ options })
138-
* @param {Object} values - option values returned in `values` by parseArgs
137+
* @param {object} options - option configs, from parseArgs({ options })
138+
* @param {object} values - option values returned in `values` by parseArgs
139139
*/
140140
function storeOption(longOption, optionValue, options, values) {
141141
if (longOption === '__proto__') {

test/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,7 @@ test('strict: when short option and suspect value then throws with whole expecte
555555

556556
assert.throws(() => {
557557
parseArgs({ args, options });
558-
// eslint-disable-next-line max-len
559-
}, /Error: Option '-w' argument is ambiguous\.\nDid you forget to specify the option argument for '-w'\?\nOr to specify an option argument starting with a dash use '--with=-XYZ' or '-w-XYZ'\./
558+
}, /To specify an option argument starting with a dash use '--with=-XYZ' or '-w-XYZ'\./
560559
);
561560
});
562561

@@ -566,7 +565,6 @@ test('strict: when long option and suspect value then throws with whole expected
566565

567566
assert.throws(() => {
568567
parseArgs({ args, options });
569-
// eslint-disable-next-line max-len
570-
}, /Error: Option '--with' argument is ambiguous\.\nDid you forget to specify the option argument for '--with'\?\nOr to specify an option argument starting with a dash use '--with=-XYZ'\./
568+
}, /To specify an option argument starting with a dash use '--with=-XYZ'/
571569
);
572570
});

0 commit comments

Comments
 (0)