cli-engine-command
Advanced tools
Comparing version
@@ -55,3 +55,3 @@ 'use strict'; | ||
try { | ||
const args = await cmd.parse(); | ||
const args = await cmd.init(); | ||
await cmd.run(args); | ||
@@ -67,2 +67,3 @@ await cmd.out.done(); | ||
this.flags = {}; | ||
this.args = {}; | ||
@@ -74,3 +75,3 @@ this.config = (0, _cliEngineConfig.buildConfig)(options.config); | ||
async parse() { | ||
async init() { | ||
const parser = new _parser2.default({ | ||
@@ -82,5 +83,6 @@ flags: this.constructor.flags || {}, | ||
}); | ||
const { argv, flags } = await parser.parse({ flags: this.flags, argv: this.argv }); | ||
const { argv, flags, args } = await parser.parse({ flags: this.flags, argv: this.argv }); | ||
this.flags = flags; | ||
this.argv = argv; | ||
this.args = args; | ||
} | ||
@@ -87,0 +89,0 @@ |
@@ -22,2 +22,3 @@ 'use strict'; | ||
output.argv = []; | ||
output.args = {}; | ||
@@ -77,2 +78,4 @@ let parseFlag = arg => { | ||
// not a flag, parse as arg | ||
let argDefinition = this.input.args[output.argv.length]; | ||
if (argDefinition) output.args[argDefinition.name] = arg; | ||
output.argv.push(arg); | ||
@@ -79,0 +82,0 @@ } |
{ | ||
"name": "cli-engine-command", | ||
"description": "base CLI command for cli-engine", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"author": "Jeff Dickey @dickeyxxx", | ||
@@ -24,3 +24,3 @@ "bugs": "https://github.com/heroku/cli-engine-command/issues", | ||
"babel-eslint": "7.2.3", | ||
"babel-jest": "20.0.1", | ||
"babel-jest": "20.0.3", | ||
"babel-plugin-transform-class-properties": "6.24.1", | ||
@@ -32,3 +32,3 @@ "babel-plugin-transform-es2015-modules-commonjs": "6.24.1", | ||
"flow-typed": "2.1.2", | ||
"jest": "20.0.1", | ||
"jest": "20.0.3", | ||
"jest-junit": "1.5.1", | ||
@@ -35,0 +35,0 @@ "nock": "9.0.13", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
136412
0.32%1988
0.25%