Permalink
Browse files

Release 2.0.0

  • Loading branch information...
1 parent bf5e1f5 commit efc585c7831f589a9ab0c9e34ed8a9ac5b97acbf @tj committed Jul 19, 2013
Showing with 6 additions and 1 deletion.
  1. +5 −0 History.md
  2. +1 −1 package.json
View
@@ -1,4 +1,9 @@
+2.0.0 / 2013-07-18
+==================
+
+ * remove input methods (.prompt, .confirm, etc)
+
1.3.2 / 2013-07-18
==================
View
@@ -1,6 +1,6 @@
{
"name": "commander"
- , "version": "1.3.2"
+ , "version": "2.0.0"
, "description": "the complete solution for node.js command-line programs"
, "keywords": ["command", "option", "parser", "prompt", "stdin"]
, "author": "TJ Holowaychuk <tj@vision-media.ca>"

9 comments on commit efc585c

Contributor

mreinstein replied Aug 1, 2013

@visionmedia why were the validation routines removed? Is there an alternative way in 2.x or are you removing this feature?

Owner

tj replied Aug 1, 2013

validation? maybe I removed something I shouldn't have, not sure what you mean

Contributor

mreinstein replied Aug 1, 2013

So currently in my usage of commanderjs I'm able to do things like this:

program.prompt('email: ', /^.+@.+\..+$/, function (email){
   // user will be infinitely re-prompted until passes validation, then we get here.
});

Is this still possible? I thought it might be gone as a result of bf5e1f5

Owner

tj replied Aug 1, 2013

oh no I removed all the input related stuff, they don't really belong in commander. Someone else put them in npm as a different package and I created a generator-friendly one: https://github.com/visionmedia/co-prompt

Contributor

mreinstein replied Aug 1, 2013

I'm guessing I need to migrate my port over to that lib. Looks like it doesn't support regex.

ok, so you took this out to make commanderjs more modular?

Owner

tj replied Aug 2, 2013

you could just stay on 1.x, nothing wrong with that. co-prompt doesn't have any validation stuff but it could, though with generators you could easily just do a while loop:

do {
  val = yield prompt('email: ')
} while (isInvalid(val))
Contributor

mreinstein replied Aug 2, 2013

I'm not complaining, I'm just trying to understand the motivation and fight software rot within my own repos. :) Would you accept a pull on visionmedia/co-prompt for regex support?

Owner

tj replied Aug 2, 2013

hmmm maybe, I like the idea of keeping validation separate personally, because otherwise we need ways to customize the message you output if it's invalid, if any, blah blah, just complicates things

Contributor

mreinstein replied Aug 2, 2013

ugh co-prompt is using yield? There are so few js engines that support it at this point.

Please sign in to comment.