diff --git a/en/appendices/5-2-migration-guide.rst b/en/appendices/5-2-migration-guide.rst index e5591004a2..d3fb16466c 100644 --- a/en/appendices/5-2-migration-guide.rst +++ b/en/appendices/5-2-migration-guide.rst @@ -17,6 +17,16 @@ Behavior Changes class is a subclass of ``BadRequestException``, and offers the benefit of being filterable from logging. +Deprecations +============ + +Console +------- + +- ``Arguments::getMultipleOption()`` is deprecated. Use ``getArrayOption()`` + instead. + + New Features ============ @@ -27,6 +37,21 @@ Console regenerate counters for models that use ``CounterCacheBehavior``. - ``ConsoleIntegrationTestTrait::debugOutput()`` makes it easier to debug integration tests for console commands. +- ``ConsoleInputArgument`` now supports a ``separator`` option. This option + allows positional arguments to be delimited with a character sequence like + ``,``. CakePHP will split the positional argument into an array when arguments + are parsed. +- ``Arguments::getArrayArgumentAt()``, and ``Arguments::getArrayArgument()`` + were added. These methods allow you to read ``separator`` delimitered + positional arguments as arrays. +- ``ConsoleInputOption`` now supports a ``separator`` option. This option + allows option values to be delimited with a character sequence like + ``,``. CakePHP will split the option value into an array when arguments + are parsed. +- ``Arguments::getArrayArgumentAt()``, ``Arguments::getArrayArgument()``, and + ``Arguments::getArrayOption()`` + were added. These methods allow you to read ``separator`` delimitered + positional arguments as arrays. ORM --- diff --git a/en/console-commands/option-parsers.rst b/en/console-commands/option-parsers.rst index be19eb79a7..c99424bf79 100644 --- a/en/console-commands/option-parsers.rst +++ b/en/console-commands/option-parsers.rst @@ -59,11 +59,16 @@ You can use the following options when creating an argument: * ``choices`` An array of valid choices for this argument. If left empty all values are valid. An exception will be raised when parse() encounters an invalid value. +* ``separator`` A character sequence that separates arguments that should be + parsed into an array. Arguments that have been marked as required will throw an exception when parsing the command if they have been omitted. So you don't have to handle that in your shell. +.. versionadded:: 5.2.0 + The ``separator`` option was added. + Adding Multiple Arguments ------------------------- @@ -140,10 +145,16 @@ of the option: Defaults to ``false``. * ``multiple`` - The option can be provided multiple times. The parsed option will be an array of values when this option is enabled. +* ``separator`` - A character sequence that the option value is split into an + array with. * ``choices`` - An array of valid choices for this option. If left empty all values are valid. An exception will be raised when parse() encounters an invalid value. + +.. versionadded:: 5.2.0 + The ``separator`` option was added. + Adding Multiple Options -----------------------