Releases: PhpGt/Cli
Default commands
If an application is intended to be run by just its name, like build
(rather than requiring build run
or build exec
or build do-the-one-thing-this-application-is-built-for
), a default command can be set, so that the application can be run without needing a command specified by the user.
Abstract Command functions
With this release, the name, description and lists of required/optional parameters are provided to Commands by implementing abstract functions.
There are two main reasons that this has been changed:
- It is impossible to forget to implement the required parts of a Command now.
- This allows the Commands' constructors to be used to have data injected from outside of the application, without interference from the setup of command parameters, etc.
Improvements to arguments
Users can pass arbitrary arguments to commands which are accessible in the ArgumentValueList to the developer (#16).
The argument value list getter can provide a default value if the user has not provided one.
Better out-of-the-box support
This minor update tidies up the way that the default commands are handled with no arguments (for example, a common usage where a user calls the application with no commands or arguments).
The default command is now always "help" and will always display the list of available commands.
v1 release
All functionality that was tagged to make its way into v1 release has been implemented and fully tested, so here it is, v1.0.0 of the Command Line Interface builder!
The main reason for the timing of this release is to allow php.gt/installer to also be released as stable, as the Installer is the next in the critical path of repositories that require stable release to get the whole of WebEngine v3 stable.
Have fun!
Streams fully tested
Simple as it is, the Stream object has been fully tested to ensure that in/out/err are identified correctly and the correct exceptions are thrown when necessary.
Full test coverage for Command
Bugs were found; bugs were fixed. Moving on to the other Command subclasses.
Minor bug fixes
Thorough testing is uncovering plenty of small bugs and improvements. No new features implemented in this pre-release, but check the diff to see the tests and changes to the Command class.
Output directly from Command
The explorative coding phase is complete and the library is beginning to take shape. In this prerelease, adjusting the code as unit test coverage increases, a backwards breaking change is introduced: the Command object now holds the write
and writeLine
functions.
Nullable parameters
This pre-release changes the API of many functions, allowing more parameters to be nullable, using default values where appropriate.