tobami / littlechef

Cook with Chef without a Chef Server
Apache License 2.0
472 stars 71 forks source link

noninteractive option #167

Closed tobami closed 11 years ago

tobami commented 11 years ago

node:all prompts the user for confirmation. --force would not ask for user input

drye commented 11 years ago

How about --noinput instead? --force sounds like you're making littlechef to do something it doesn't want to do :)

tobami commented 11 years ago

You have a point there :smile:

Now that I think of it, there is a similar case, for deploy_chef, where you can pass it ask=no. Both could be unified under a single command line option instead.

Looking at existing patterns, we could adopt what apt-get uses:

-y, --yes, --assume-yes
    Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively

Sounds about right!

drye commented 11 years ago

Sounds ok. I gave --noinput as an example because that's what Django uses.

Thinking about it more, --assume-yes assumes that the default option will always be "yes". I can't see into the future of this project, but maybe not all the prompts will be yes or no questions. Imagine a prompt about a path, and the default path is the current path.

Perhaps --non-interactive would be the best way to go? :)

tobami commented 11 years ago

Well, '-y' will answer "yes" to any LittleChef confirmation dialog, and turn on fabric's "abort_on_prompt". Meaning, if password is asked, or anything else while executing or configuring something, the run will abort, which is about right for an automatic, noninteractive node.

For LittleChef itself ideally we should not need to ask the user anything that has a default, though of course you never know

drye commented 11 years ago

Not that big a deal, but made for an interesting discussion. ;) Keep up the good work!

tobami commented 11 years ago

Sure! In any case the final solution (-y) is much nicer than the original proposal (--force), so thanks for that!