@oclif/parser
Advanced tools
Comparing version 3.7.2 to 3.7.3
@@ -0,1 +1,10 @@ | ||
## [3.7.3](https://github.com/oclif/parser/compare/v3.7.2...v3.7.3) (2019-03-15) | ||
### Bug Fixes | ||
* ignore defaulted flags for exclusivity ([1dfe62a](https://github.com/oclif/parser/commit/1dfe62a)) | ||
## [3.7.2](https://github.com/oclif/parser/compare/v3.7.1...v3.7.2) (2018-12-18) | ||
@@ -2,0 +11,0 @@ |
import { Arg } from './args'; | ||
import * as Flags from './flags'; | ||
import { Metadata } from './metadata'; | ||
export declare type OutputArgs<T extends ParserInput['args']> = { | ||
@@ -14,2 +15,3 @@ [P in keyof T]: any; | ||
raw: ParsingToken[]; | ||
metadata: Metadata; | ||
}; | ||
@@ -40,2 +42,3 @@ export declare type ArgToken = { | ||
private readonly context; | ||
private readonly metaData; | ||
private currentFlag?; | ||
@@ -48,2 +51,3 @@ constructor(input: T); | ||
raw: ParsingToken[]; | ||
metadata: any; | ||
}; | ||
@@ -50,0 +54,0 @@ private _args; |
@@ -29,2 +29,3 @@ "use strict"; | ||
this.booleanFlags = pickBy(input.flags, f => f.type === 'boolean'); | ||
this.metaData = {}; | ||
} | ||
@@ -120,2 +121,3 @@ parse() { | ||
raw: this.raw, | ||
metadata: this.metaData | ||
}; | ||
@@ -133,2 +135,3 @@ } | ||
const flags = {}; | ||
this.metaData.flags = {}; | ||
for (const token of this._flagTokens) { | ||
@@ -172,2 +175,3 @@ const flag = this.input.flags[token.flag]; | ||
if (!(k in flags) && flag.default !== undefined) { | ||
this.metaData.flags[k] = { setFromDefault: true }; | ||
if (typeof flag.default === 'function') { | ||
@@ -174,0 +178,0 @@ flags[k] = flag.default(Object.assign({ options: flag, flags }, this.context)); |
@@ -41,2 +41,7 @@ "use strict"; | ||
for (let also of flag.exclusive || []) { | ||
// do not enforce exclusivity for flags that were defaulted | ||
if (parse.output.metadata.flags[also] && parse.output.metadata.flags[also].setFromDefault) | ||
continue; | ||
if (parse.output.metadata.flags[name] && parse.output.metadata.flags[name].setFromDefault) | ||
continue; | ||
if (parse.output.flags[also]) { | ||
@@ -43,0 +48,0 @@ throw new errors_1.CLIError(`--${also}= cannot also be provided when using --${name}=`); |
{ | ||
"name": "@oclif/parser", | ||
"description": "arg and flag parser for oclif", | ||
"version": "3.7.2", | ||
"version": "3.7.3", | ||
"author": "Jeff Dickey @jdxcode", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/oclif/parser/issues", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
45924
30
852
3
1