Comparing version 16.0.0-beta.1 to 16.0.0-beta.2
@@ -62,3 +62,3 @@ import { argsert } from './argsert.js'; | ||
}; | ||
self.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand) { | ||
self.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand, checkPositionals = true) { | ||
const commandKeys = yargs.getCommandInstance().getCommands(); | ||
@@ -75,3 +75,3 @@ const unknown = []; | ||
}); | ||
if ((currentContext.commands.length > 0) || (commandKeys.length > 0) || isDefaultCommand) { | ||
if (checkPositionals && ((currentContext.commands.length > 0) || (commandKeys.length > 0) || isDefaultCommand)) { | ||
argv._.slice(currentContext.commands.length).forEach((key) => { | ||
@@ -78,0 +78,0 @@ if (commandKeys.indexOf('' + key) === -1) { |
@@ -116,2 +116,3 @@ import { command as Command } from './command.js'; | ||
strictCommands, | ||
strictOptions, | ||
completionCommand, | ||
@@ -145,2 +146,3 @@ output, | ||
strictCommands, | ||
strictOptions, | ||
completionCommand, | ||
@@ -709,2 +711,9 @@ parseFn, | ||
self.getStrictCommands = () => strictCommands; | ||
let strictOptions = false; | ||
self.strictOptions = function (enabled) { | ||
argsert('[boolean]', [enabled], arguments.length); | ||
strictOptions = enabled !== false; | ||
return self; | ||
}; | ||
self.getStrictOptions = () => strictOptions; | ||
let parserConfig = {}; | ||
@@ -1050,2 +1059,5 @@ self.parserConfiguration = function parserConfiguration(config) { | ||
} | ||
else if (strictOptions) { | ||
validation.unknownArguments(argv, aliases, {}, false, false); | ||
} | ||
validation.customChecks(argv, aliases); | ||
@@ -1052,0 +1064,0 @@ validation.limitedChoices(argv); |
{ | ||
"name": "yargs", | ||
"version": "16.0.0-beta.1", | ||
"version": "16.0.0-beta.2", | ||
"description": "yargs the modern, pirate-themed, successor to optimist.", | ||
@@ -15,3 +15,3 @@ "main": "./index.cjs", | ||
"./yargs": { | ||
"require": "./build/index.cjs" | ||
"require": "./yargs.cjs" | ||
} | ||
@@ -32,2 +32,3 @@ }, | ||
"index.mjs", | ||
"yargs.mjs", | ||
"build", | ||
@@ -45,3 +46,3 @@ "locales", | ||
"string-width": "^4.2.0", | ||
"y18n": "^4.0.0", | ||
"y18n": "^5.0.1", | ||
"yargs-parser": "^19.0.4" | ||
@@ -99,4 +100,2 @@ }, | ||
"build", | ||
"index.cjs", | ||
"yargs.cjs", | ||
"**/example/**" | ||
@@ -103,0 +102,0 @@ ] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
291588
6753
+ Addedy18n@5.0.8(transitive)
- Removedy18n@4.0.3(transitive)
Updatedy18n@^5.0.1