Comparing version 0.0.1 to 0.0.2
@@ -81,2 +81,7 @@ 'use strict'; | ||
// Command After | ||
if (commandPipe.after) { | ||
pipelineArray.push(result => commandPipe.after(result, parsedArgs, positionalArgs, argsAfterEndOfOptions)); | ||
} | ||
// Options After | ||
@@ -87,7 +92,2 @@ if (optionsPipe.after) { | ||
// Command After | ||
if (commandPipe.after) { | ||
pipelineArray.push(result => commandPipe.after(result, parsedArgs, positionalArgs, argsAfterEndOfOptions)); | ||
} | ||
// Exec pipeline | ||
@@ -111,49 +111,2 @@ const pipeResult = pipeFn(...pipelineArray); | ||
// function execCommandPipeline(command, parsedArgs, pipeline = {}) { | ||
// const positionalArgs = parsedArgs._; | ||
// const argsAfterEndOfOptions = parsedArgs['--']; | ||
// delete parsedArgs._; | ||
// delete parsedArgs['--']; | ||
// let pipelineArray = []; | ||
// // Wait for stdin or start passing in parsedArgs | ||
// if (pipeline.stdin) { | ||
// pipelineArray.push(getStdin); | ||
// pipelineArray.push(stdinValue => checkStdin(pipeline.stdin, stdinValue, parsedArgs, positionalArgs, argsAfterEndOfOptions)); | ||
// } else { | ||
// pipelineArray.push(parsedArgs); | ||
// } | ||
// // Before | ||
// if (pipeline.before) { | ||
// pipelineArray.push(args => pipeline.before(args, positionalArgs, argsAfterEndOfOptions)); | ||
// } | ||
// // Main Command | ||
// pipelineArray.push(args => prepareArgsAndCall(command, args, ...positionalArgs)); | ||
// // After | ||
// if (pipeline.after) { | ||
// pipelineArray.push(result => pipeline.after(result, parsedArgs, positionalArgs, argsAfterEndOfOptions)); | ||
// } | ||
// // Exec pipeline | ||
// const pipeResult = pipeFn(...pipelineArray); | ||
// // Output Promises | ||
// if (pipeResult && pipeResult.then) { | ||
// return pipeResult | ||
// .then(result => result !== undefined && console.log(result)) | ||
// .catch(console.error); | ||
// } | ||
// // console.log('pipeResult', command\); | ||
// // Output | ||
// if (pipeResult !== undefined) { | ||
// console.log(pipeResult); | ||
// } | ||
// } | ||
function matchCommandFromArgs(args, command, commandPath = []) { | ||
@@ -160,0 +113,0 @@ commandPath.push(command.name); |
{ | ||
"name": "cliss", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "CLI Simple, Stupid. Automatic discovery of parameters names. Provides an easy and minimal setup by passing in only a function reference without the need of declaring all expected options names or create a help section by hand. Support to sync / async. Support to subcommands down to N levels.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/cliss.js", |
Sorry, the diff of this file is not supported yet
35690
16
651