dthree / vorpal

Node's framework for interactive CLIs
http://vorpal.js.org
MIT License
5.64k stars 280 forks source link

Calling internal commands #121

Closed ccorcos closed 8 years ago

ccorcos commented 8 years ago

It would be cool if you could execute a command using the -c option just like in bash.

node main.js -c "my-command"

It could also be cool if you could require the node file and run commands manually. This way we can share the CLI code.

ccorcos commented 8 years ago

Not sure what you're talkig about there. I'm saying that i have a command:

vorpal.command('my-command').action(/*...*/)

and I'd like to be able to run that command from a bash script.

ristomatti commented 8 years ago

@ccorcos, you can use vorpal.parse(process.argv) to run a command given as an argument. Doing that only when -c is given as a parameter should be quite easy thing to add to your own app. Adding it to Vorpal by default would require an unnecessary major version bump as someone might already be using it for their own app (and therefore being a breaking change).

ccorcos commented 8 years ago

awesome. .parse should do it though! thanks

On Mon, Feb 29, 2016 at 2:29 PM, Ristomatti Airo notifications@github.com wrote:

@ccorcos https://github.com/ccorcos, you can use vorpal.parse(process.argv) to run the commands given as arguments. Doing that only when -c is given as a parameter should be quite easy thing to add to your own app. Adding it to Vorpal by default would require an unnecessary major version bump as someone might already be using it for their own app (and therefore being a breaking change).

— Reply to this email directly or view it on GitHub https://github.com/dthree/vorpal/issues/121#issuecomment-190428978.

dthree commented 8 years ago

@ristomatti nailed it. Closing this issue.

@ccorcos if you have any question on Vorpal, feel free to ask in Stack Overflow! I'm very fast to respond, among others, and it helps build the general knowledge base.

GranularDetective commented 8 years ago

No. You do not ever close this issue because you haven't fixed the underlying problem as you know dthree.

GranularDetective commented 8 years ago

Of course, if you edit the compiler you can force the compiler to run from bash but to force a compiler to run is completely wrong and will cause a huge number of problems for you down the line.

dthree commented 8 years ago

@GranularDetective your comments are not sequitur to the discussion. It honestly sounds like you're trolling, which will get you blocked.

GranularDetective commented 8 years ago

You don't understand what I'm telling you or more likely you are pretending not to understand.