8000 [WIP] [Console] added a better way to ask questions to the user by fabpot · Pull Request #9811 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[WIP] [Console] added a better way to ask questions to the user #9811

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

Closed
wants to merge 1 commit into from

Conversation

fabpot
Copy link
Member
@fabpot fabpot commented Dec 18, 2013
Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR not yet

Todo:

  • add missing phpdocs
  • add unit tests
  • submit doc PR

$matches = $autocomplete;
$numMatches = count($matches);

$sttyMode = shell_exec('stty -g');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not using a new Process()? just curious

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To no add an hard dependency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should check if stty is available at first?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stof
Copy link
Member
stof commented Dec 18, 2013

Please make your new helper aware of the interactive mode of the console input, so that we don't have to check manually each time we use it in order to keep the --no-interaction flag working. Most fully interactive commands are not putting their interaction in interact before the execution, but in the middle of the execution when they need it.
This issue was fixed for dialogHelper in #8452 (in a hacky way IMO as I don't find the InputAwareInterface that clean, but it was needed because of BC concerns). The QuestionHelper should take this constraint into account since its first released implementation

$this->fallback = (Boolean) $fallback;
}

public function getAutocompler()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be na 8000 med getAutocompleter

/**
* Sets the input stream to read from when interacting with the user.
*
* This is mainly useful for testing purpose.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

purposes

@stof
Copy link
Member
stof commented Mar 4, 2014

@fabpot what is the status on this PR ?

fabpot added a commit that referenced this pull request Apr 2, 2014
…ser (fabpot, romainneutron)

This PR was merged into the 2.5-dev branch.

Discussion
----------

[Console] added a better way to ask questions to the user

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | not yet

This PR replaces #9811

- [x] add missing phpdocs
- [x] add unit tests
- [ ] submit doc PR

Commits
-------

336bba2 [Console] Add docblocks and unit tests to QuestionHelper
c413f89 [Console] added a better way to ask questions to the user
@romainneutron
Copy link
Contributor

This PR can be closed

@fabpot
Copy link
Member Author
fabpot commented Apr 3, 2014

Closing in favor of #10606

@fabpot fabpot closed this Apr 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants
0