Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt functions #44

Closed
marcooliveira opened this issue Jan 11, 2013 · 7 comments
Closed

Prompt functions #44

marcooliveira opened this issue Jan 11, 2013 · 7 comments

Comments

@marcooliveira
Copy link
Member

It would be useful to provide the user with prompt functions in the task context, so he can request information to the user, if necessary. We could provide something like ctx.prompt, with a few functions.

Check https://github.com/visionmedia/commander.js/#promptmsg-fn for examples of these functions.

@marcooliveira
Copy link
Member Author

Relates to #45

@satazor
Copy link
Member

satazor commented Jan 26, 2013

I like the API of commander and dislike this one: https://github.com/flatiron/prompt

@satazor
Copy link
Member

satazor commented Jan 26, 2013

After evaluating, I decided to implement a separate nodejs module for this.
We could use commander's one but we would have to depend on a lot of things just for the prompt functions. Besides that, we are using optimist instead of commander.

Check it out: https://github.com/IndigoUnited/node-promptly
It has a simple API. Everything is done, except for the password prompt.

@satazor
Copy link
Member

satazor commented Jan 27, 2013

Ok everything is done. Under the hood, it uses isaac's read node module.

@satazor
Copy link
Member

satazor commented Jan 27, 2013

@marcooliveira I'm going to integrate promptly in automaton.
Question: should we preserve the indentation when questioning things to the user or not?
If not, context.prompt = promptly, otherwise we must have a proxy to indent the prompt messages.

@marcooliveira
Copy link
Member Author

Very nice! I like the module, simple as it should be ;)

Good question. Having prompts indent like logging does, can eventually put the prompt in an awkward position. Let's take a practical look at this. I think most people will only depend on user input on top tasks. Even if they read values from inner tasks, I don't think it's a must to have them indented. If this proves to be an annoyance, we can always indent later. This also makes automaton more efficient.

satazor added a commit that referenced this issue Jan 30, 2013
@satazor satazor closed this as completed Jan 30, 2013
@satazor
Copy link
Member

satazor commented Jan 30, 2013

Btw I've added this in the context, but since we don't make indentation, it is context independent.
As soon as #45 is done, we can move it there or not...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants