CliToolkit -> Changelog
This change log references the repository changes and releases, which respect semantic versioning.
-
PHP minimal required version is 8.3.
- Set explicitly types for all classes constants.
-
Config::createHelpOption()is deleted because not needed anymore (see the point below). -
Parametizer::setExceptionHandlerForParsing()requires aCliRequestProcessorobject,HelpGenerator::getUsageForParseErrorException()requires aConfigobject as the second parameter,CliRequestProcessor::__construct()is added with a requiredConfigobject parameter,CliRequestProcessor::load()signature is changed -Configobject parameter is removed. This way it's possible to get an innermost branch config forParseErrorExceptioninstances. -
$isForStdErrparameter is removed fromHelpGenerator::getUsageForParseErrorException(), the method always use a formatter for STDERR stream. -
Parametizer::setExceptionHandlerForParsing()renders both an error message and a help block in STDERR (previously a help block was rendered in STDOUT). -
Option::getOptionCleanFullName()is deleted because of no usage. -
Renaming:
CliRequest::getCommandRequest()->getSubcommandRequest()CliRequestProcessor::getAllowedArguments()->getInnermostBranchAllowedArguments()CliRequestProcessor::append()->appendToInnermostBranch()
-
HelpGenerator::getUsageTemplate()is made protected (from public) and non-static. Then it's able to use an instance$formatterproperty (instead of creating a separate formatter instance).
- Added Environment Config that allows setting "environment"-related
options like a short name for built-in
--helpoption and short description boundaries. Other changes provoked by this addition:Config::__construct(),ConfigBuilder::__construct()andParametizer::newConfig()support a new optional parameter$envConfigto passEnvironmentConfiginstance.- Added
Config::$envConfigprotected property to keepEnvironmentConfiginstance and the relatedgetEnvConfig()public method.
CliRequestprovidesgetParamAs*helper methods for easier parameters' values type casting, see Features Manual: Type casting from requests.- Added
HelpGenerator::getShortDescription()that is used to show short versions for subcommand descriptions, when outputting a help page for a script with a list of available subcommands.
- Added a paragraph about subcommands into Features Manual: Subcommands.
- Formatted subcommand value in
HelpGenerator::getUsageTemplate(), so subcommands would be more visible in the 'COMMANDS' section of a help page with a list of available subcommands. - Fixed autocompletion for option short names in subcommands.
- Made autocompletion smarter: duplicate option and value mentioning is not completed.
The first official release. Mainly focused on Cliff improvements and some additions like:
- more transparent and convenient config builder;
- generate-autocompletion-scripts.php (eases autocompletion init);
- TerminalFormatter (helps format the improved generated help pages);
- Question (helps implement interactive scripts);
- PHPUnit for autotests plus more autotests.