Skip to content

[Console] Add documentation for Console Negatable option #14787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion console/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ separation at all (e.g. ``-i 5`` or ``-i5``).
this situation, always place options after the command name, or avoid using
a space to separate the option name from its value.

There are four option variants you can use:
There are five option variants you can use:

``InputOption::VALUE_IS_ARRAY``
This option accepts multiple values (e.g. ``--dir=/foo --dir=/bar``);
Expand All @@ -216,6 +216,14 @@ There are four option variants you can use:
This option may or may not have a value (e.g. ``--yell`` or
``--yell=loud``).

``InputOption::VALUE_NEGATABLE``
Accept either the flag (e.g. ``--yell``) or its negation (e.g.
``--no-yell``).

.. versionadded:: 5.3

The ``InputOption::VALUE_NEGATABLE`` constant was introduced in Symfony 5.3.

You can combine ``VALUE_IS_ARRAY`` with ``VALUE_REQUIRED`` or
``VALUE_OPTIONAL`` like this::

Expand Down