Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Console] End of options (--) signal support#11431

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Seldaek wants to merge3 commits intosymfony:masterfromSeldaek:argv_delimiter

Conversation

Seldaek
Copy link
Member

QA
Bug fix?yes
New feature?yes
BC breaks?yes-ish
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

The first commit is only about -- support + fixes a few other little issues I discovered while adding tests to cover my feature.
The second commit makes use of the first in the Application class, so that if you doconsole foo -- --help for example, it should not trigger the help anymore, but simply have --help available as a dummy arg.

To keep BC, I did this by adding a param to hasParameterOption/getParameterOption instead of doing it by default. This creates another BC issue though in that it changes the InputInterface. I don't think that's a major concern but it's worth mentioning.

The other only minor BC change is if you do getParameterOption() of a flag option i.e.--foo without a value. Before it was returning null in ArgvInput and true in ArrayInput. I normalized this to true for both since I think that makes more sense, but strictly speaking while it improves interface interchangeability, it's a BC break.

@wouterj
Copy link
Member

Big 👍 for supporting--, however ...

To keep BC, I did this by adding a param to hasParameterOption/getParameterOption instead of doing it by default. This creates another BC issue though in that it changes the InputInterface. I don't think that's a major concern but it's worth mentioning.

Following thebc promise, you are allowed to do this since theInputInterface isn't tagged as public API, but you have to follow: "Should be avoided. When done, this change must be documented in the UPGRADE file."

However, it seems more like a bug that theInputInterface is not tagged as public API, since ,for instance,OutputInterface is. In case this is true (@fabpot?), you are no longer allowed to do this.

The other only minor BC change is if you do getParameterOption() of a flag option i.e. --foo without a value. Before it was returning null in ArgvInput and true in ArrayInput. I normalized this to true for both since I think that makes more sense, but strictly speaking while it improves interface interchangeability, it's a BC break.

SinceArgvInput is part of the public API, you are not allowed to change the return type following the BC promise. Also, changingnull totrue means every statement using it will fail (sincenull is a falsey value andtrue is not).

@Seldaek
Copy link
MemberAuthor

@wouterj regarding the interface. If we can't change it, we can just skip those changes on the interface. Since the new param is optional implementors can add that to the interface AFAIK without breaking anything.

As for ArgvInput.. I can make ArrayInput return null if that's preferable. I don't really mind either way, but anyway it's very unlikely anyone called getParameterOption on an option that doesn't take a value, that'd be kinda useless since hasParameterOption tells you if it's there or not already. Not sure how strictly we want to adhere to the book. By the book isn't my specialty so I'll defer to others :)

@TomasVotruba
Copy link
Contributor

What's the current state of this?

@Seldaek
Copy link
MemberAuthor

I am not sure. I think it was ready but sure should be reviewed. /cc @symfony/deciders

@xabbuh
Copy link
Member

I think this is a good idea and since we need to change the interface (there is no other way to solve this, is there?) it would be a good fit for 3.0.

@xabbuh
Copy link
Member

@Seldaek Is it much work to rebase this onmaster? Would be interesting to if tests still pass.

@SeldaekSeldaekforce-pushed theargv_delimiter branch 2 times, most recently from041fa6b to6872c84CompareNovember 2, 2015 06:40
@Seldaek
Copy link
MemberAuthor

Rebased.. It can apply on 2.8 or master.

@xabbuh
Copy link
Member

Something seems to be broken (tests in the FrameworkBundle report not existing arguments).

@Seldaek
Copy link
MemberAuthor

OK build is fixed, travis anyway, appveyor seems unrelated.

@fabpot
Copy link
Member

Thank you@Seldaek.

fabpot added a commit that referenced this pull requestNov 5, 2015
This PR was squashed before being merged into the 3.0-dev branch (closes#11431).Discussion----------[Console] End of options (--) signal support| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | yes| BC breaks?    | yes-ish| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |The first commit is only about -- support + fixes a few other little issues I discovered while adding tests to cover my feature.The second commit makes use of the first in the Application class, so that if you do `console foo -- --help` for example, it should not trigger the help anymore, but simply have --help available as a dummy arg.To keep BC, I did this by adding a param to hasParameterOption/getParameterOption instead of doing it by default. This creates another BC issue though in that it changes the InputInterface. I don't think that's a major concern but it's worth mentioning.The other only minor BC change is if you do getParameterOption() of a flag option i.e. `--foo` without a value. Before it was returning null in ArgvInput and true in ArrayInput. I normalized this to true for both since I think that makes more sense, but strictly speaking while it improves interface interchangeability, it's a BC break.Commits-------834218e [Console] End of options (--) signal support
@fabpotfabpot closed thisNov 5, 2015
@fabpotfabpot mentioned this pull requestNov 16, 2015
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@Seldaek@wouterj@TomasVotruba@xabbuh@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp