Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] --help, -h, --version, -V arguments blacklisted from command processing #21869

Closed
@ktomk

Description

@ktomk
Q A
Bug report? yes
Symfony version 2.7, 2.8, master

The Symfony Console component (in Application) contains special treatment for four/two pairs of command-line options (flags):

  1. version: --version / -V source
  2. help: --help / -h source

which prevents executing the entered command.

The Application assumes that any of these four switches are directed on either the app itself (the version switches) and/or the command (the help switches).

This assumption is flawed. Not all command-line arguments (the Symfony Console nomenclature is raw arguments) can be expected to be handled by the Console component base-classes directly.

Practical examples where this is flawed is when these arguments are actually entered to be processed as arguments for the command itself, like file-names or additional arguments that will get passed to another process (e.g. with composer run-script -- test --help)..

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions