Skip to content

Latest commit

 

History

History
60 lines (49 loc) · 3.58 KB

File metadata and controls

60 lines (49 loc) · 3.58 KB

CliToolkit -> Changelog

This change log references the repository changes and releases, which respect semantic versioning.

v2.0.0

Backward incompatibilities:

  1. PHP minimal required version is 8.3.

    1. Set explicitly types for all classes constants.
  2. Config::createHelpOption() is deleted because not needed anymore (see the point below).

  3. Parametizer::setExceptionHandlerForParsing() requires a CliRequestProcessor object, HelpGenerator::getUsageForParseErrorException() requires a Config object as the second parameter, CliRequestProcessor::__construct() is added with a required Config object parameter, CliRequestProcessor::load() signature is changed - Config object parameter is removed. This way it's possible to get an innermost branch config for ParseErrorException instances.

  4. $isForStdErr parameter is removed from HelpGenerator::getUsageForParseErrorException(), the method always use a formatter for STDERR stream.

  5. Parametizer::setExceptionHandlerForParsing() renders both an error message and a help block in STDERR (previously a help block was rendered in STDOUT).

  6. Option::getOptionCleanFullName() is deleted because of no usage.

  7. Renaming:

    1. CliRequest::getCommandRequest() -> getSubcommandRequest()
    2. CliRequestProcessor::getAllowedArguments() -> getInnermostBranchAllowedArguments()
    3. CliRequestProcessor::append() -> appendToInnermostBranch()
  8. HelpGenerator::getUsageTemplate() is made protected (from public) and non-static. Then it's able to use an instance $formatter property (instead of creating a separate formatter instance).

New features

  1. Added Environment Config that allows setting "environment"-related options like a short name for built-in --help option and short description boundaries. Other changes provoked by this addition:
    1. Config::__construct(), ConfigBuilder::__construct() and Parametizer::newConfig() support a new optional parameter $envConfig to pass EnvironmentConfig instance.
    2. Added Config::$envConfig protected property to keep EnvironmentConfig instance and the related getEnvConfig() public method.
  2. CliRequest provides getParamAs* helper methods for easier parameters' values type casting, see Features Manual: Type casting from requests.
  3. 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.

Patching

  1. Added a paragraph about subcommands into Features Manual: Subcommands.
  2. 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.
  3. Fixed autocompletion for option short names in subcommands.
  4. Made autocompletion smarter: duplicate option and value mentioning is not completed.

v1.0.0

The first official release. Mainly focused on Cliff improvements and some additions like: