8000 [Console] Don't go past exact matches when autocompleting by nicolas-grekas · Pull Request #26875 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] Don't go past exact matches when autocompleting #26875

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
Apr 10, 2018

Conversation

nicolas-grekas
Copy link
Member
Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #21789
License MIT
Doc PR -

@nicolas-grekas nicolas-grekas added this to the 2.7 milestone Apr 9, 2018
@nicolas-grekas nicolas-grekas changed the title [Console] Don't go past exact matches when autcompleting [Console] Don't go past exact matches when autocompleting Apr 9, 2018
$question = new ChoiceQuestion('Please select a city', $possibleChoices);
$question->setMaxAttempts(1);

$this->assertSame('b', $dialog->ask($this->createInputInterfaceMock(), $this->createOutputInterface(), $question));
Copy link
Member
@chalasr chalasr Apr 10, 2018

Choose a reason for hiding this comment

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

for merger: createInputInterfaceMock() to be replaced by createStreamableInputInterfaceMock() on 3.4

@chalasr
Copy link
Member
chalasr commented Apr 10, 2018

Thank you @nicolas-grekas.

@chalasr chalasr merged commit adba79a into symfony:2.7 Apr 10, 2018
chalasr added a commit that referenced this pull request Apr 10, 2018
…(nicolas-grekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[Console] Don't go past exact matches when autocompleting

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21789
| License       | MIT
| Doc PR        | -

Commits
-------

adba79a [Console] Don't go past exact matches when autocompleting
@nicolas-grekas nicolas-grekas deleted the console-fix-autoc branch April 14, 2018 14:32
@fabpot fabpot mentioned this pull request Apr 27, 2018
This was referenced Apr 30, 2018
@lcp0578
Copy link
lcp0578 commented Jun 5, 2019

on windows MINGW32.

php bin/console kit:doctrine:generate:entity -vvv

Welcome to the kitlabs Doctrine2 entity generator

This command helps you generate Doctrine2 entities.

First, you need to give the entity name you want to generate.
You must use the shortcut notation like AcmeBlogBundle:Post.

The Entity shortcut name: ProcessBundle:Test
P[K7rocessBundle8r[K7ocessBundle8o[K7cessBundle8c[K7essBundle8e[K7ssBundle8s[K7sBundle8s[K7Bundle8B[K7undle8u[K7ndle8n[K7dle8d[K7le8l[K7e
8e[K78:[KT[Ke[Ks[Kt[K
Enter table comment: 测试

In QuestionHelper.php line 175:

[Symfony\Component\Console\Exception\RuntimeException]
Aborted.

Exception trace:
() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Component\Console\Helper\QuestionHelper.php:175
Symfony\Component\Console\Helper\QuestionHelper->doAsk() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Component\Console\Helper\QuestionHelper.php:80

Symfony\Component\Console\Helper\QuestionHelper->ask() at D:\phpStudy\WWW\space2019\law\vendor\kitlabs\kit-generator-bundle\Command\GenerateDoctrineEntityCommand.php:167
Kit\GeneratorBundle\Command\GenerateDoctrineEntityCommand->interact() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Component\Console\Command\Command
.php:240
Symfony\Component\Console\Command\Command->run() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:987
Symfony\Component\Console\Application->doRunCommand() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:86

Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:25
5
Symfony\Component\Console\Application->doRun() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Console\Application.php:74
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at D:\phpStudy\WWW\space2019\law\vendor\symfony\symfony\src\Symfony\Component\Console\Application.php:148
Symfony\Component\Console\Application->run() at D:\phpStudy\WWW\space2019\law\bin\console:27

kit:doctrine:generate:entity [--entity [ENTITY]] [--table_comment [TABLE_COMMENT]] [--fields FIELDS] [--format FORMAT] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--
version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] []

the code: \vendor\symfony\symfony\src\Symfony\Component\Console\Helper\QuestionHelper.php:175

 if (false === $ret) {
               $ret = fgets($inputStream, 4096);
               if (false === $ret) {
                   throw new RuntimeException('Aborted.');
               }
               $ret = trim($ret);
           }

but, when i use cmd.exe i can't input chinese word.
on my macbook it it ok.
my extends bundle github.com/kitlabs-cn/KitGeneratorBundle

@lcp0578
Copy link
lcp0578 commented Jun 5, 2019

#31870

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0