thephpleague / climate

PHP's best friend for the terminal.
http://climate.thephpleague.com
MIT License
1.87k stars 123 forks source link

Non-interactive terminals #30

Open sagikazarmark opened 9 years ago

sagikazarmark commented 9 years ago

It is often a possibility to disable interactive console when running an application.

Is it possible to have it in CLImate? It probably only makes sense with the Input.

So when the interactive mode is disabled, prompts should either return their default value or null. It is the application's responsibility to handle any other cases, like getting the data from an option.

duncan3dc commented 5 years ago

I've done some initial work on this, you can try it out like so:

composer require league/climate:dev-interactive-mode
$climate->setInteractive(false);

There's still a few things to resolve, and this might need to go in the next major due to prompt() no longer being guaranteed to return a value in some scenarios (eg checkboxes, etc).

But if you want to take it for a spin and provide any feedback that would be useful