Writing a Reddit reader using RxPHP
This and many upcoming apps we're going to build will be pure CLI apps. That said, it'll be helpful to have some unified library that'll help us with things common in the CLI environment:
The tool of choice for us is going to be Symfony Console component ( http://symfony.com/doc/current/components/console.html ). It's an open-source library developed along with the Symfony framework, but it's designed to be used independently in any project, which is ideal for us.
It handles everything from inputs to outputs, and on top of that, it comes with a few very nifty helpers as well. In particular, we're going to use the following:
Coloring and formatting the console output
Splitting a CLI app into multiple independent commands
Automatically generating help from an input parameter definition
Handling input parameters, including validation and default values
Creating a unified set of functions to handle user input
In this example, we're going to use just the first two...