Coder Social home page Coder Social logo

Comments (3)

flkasper avatar flkasper commented on June 3, 2024

Reproducible and should concern all versions.
But it's quite easy to explain. command is (currently) reserved for the internal command name.

In my opinion, the solution should be as @cavias has described.

In the simplest case, command is treated as a reserved name and an exception is thrown when an argument is added with it.

Of course, it would be nicer if you could also use command as the argument name.
Renaming the internal command name would be a breaking change and would not completely rule out further collisions.

A separation of argument and command name handling should be possible to a limited extent by taking the position into account during tokenizing (command name is always in the first position).
This would work in ArgvInput, but not for ArrayInput (used, for example, to call other commands).
There, the name of the command/argument/option is used as the key, example['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar'].

from symfony.

chalasr avatar chalasr commented on June 3, 2024

I would consider command a "reserved" argument name.
If we can do something to make it more explicit and ease understanding it, without breaking existing code (even if that code works by chance/luck), let's do it.

But to be honest, such edge cases exist for sure and we definitely don't want to break them, nor ask them to find another way to solve their need especially as it is likely to be more involving than just renaming command to something else in their application (thinking to OSS or proprietary tools using/extending/hacking the console, there's a lot).

That said, if you don't have a real use case I suggest not putting much effort into this and eventually close.

from symfony.

cavias avatar cavias commented on June 3, 2024

I would consider command a "reserved" argument name. If we can do something to make it more explicit and ease understanding it, without breaking existing code (even if that code works by chance/luck), let's do it.

But to be honest, such edge cases exist for sure and we definitely don't want to break them, nor ask them to find another way to solve their need especially as it is likely to be more involving than just renaming command to something else in their application (thinking to OSS or proprietary tools using/extending/hacking the console, there's a lot).

That said, if you don't have a real use case I suggest not putting much effort into this and eventually close.

I ran into this because I wanted to have an argument named "command" because of some custom usecase. But I just changed the argument into some other name as the name of the argument is arbitrary.

The main issue I had is that I spend an hour figuring out why my other arguments were failing to register for no obvious reason, only to find this bug.
And I imagine someone else will run into this as well in the future, which is why I recommend this is resolved somehow.

from symfony.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.