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

Skip to content

[WCM] Question Helper - Showing the default answer #4254

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 4 commits into from
Closed

[WCM] Question Helper - Showing the default answer #4254

wants to merge 4 commits into from

Conversation

ThomasLomas
Copy link
Contributor

Q A
Doc fix? no
New docs? yes - symfony/symfony#11975
Applies to 2.6
Fixed tickets

This is the documentation for a new feature that I am proposing.

@@ -62,6 +62,23 @@ some name which will be returned by the
:method:`Symfony\\Component\\Console\\Helper\\QuestionHelper::ask` method.
If they leave it empty, the default value (``AcmeDemoBundle`` here) is returned.

Showing the default answer
Copy link
Member

Choose a reason for hiding this comment

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

This should be "Showing the Default Answer" (only closed class words are not capititalized in our headlines)

@ThomasLomas
Copy link
Contributor Author

Thanks for highlighting these issues. They have been fixed in 87259b6

@@ -62,6 +62,23 @@ some name which will be returned by the
:method:`Symfony\\Component\\Console\\Helper\\QuestionHelper::ask` method.
If they leave it empty, the default value (``AcmeDemoBundle`` here) is returned.

Showing the Default Answer
..........................
Copy link
Member

Choose a reason for hiding this comment

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

You should use ~ characters as the underline character.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit de7691e

@xabbuh
Copy link
Member

xabbuh commented Sep 21, 2014

By the way, the target version of this would be 2.6 instead of 2.5.

@ThomasLomas
Copy link
Contributor Author

Updated target version


Sometimes, it is beneficial for the user to be aware of the default answer should
they decide not to give one. If you want the user to know, you can add this to your
command::
Copy link
Member

Choose a reason for hiding this comment

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

I think we should reword this a bit to something like this:

Sometimes you want to present the default answer to the user that will be
chosen if they don't provide an answer themself. Use the
:method:`Symfony\\Component\\Console\\Question\\Question::setDefault` method
to show the default answer::

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that this reads better, though the incorrect method is referenced and it would be "themselves" instead of "themself". It would read as follows:

Sometimes you want to present the default answer to the user that will be
chosen if they don't provide an answer themselves. Use the
:method:`Symfony\\Component\\Console\\Question\\Question::setShowDefault` method
to show the default answer::

Let me know and i'll commit this.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with the change to the method names. Thanks for catching this. Though "themself" is correct. It's the gender neutral form of himself/herself. "Therselves" is plural not singular.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for explaining. I've committed this with "themself".

@xabbuh
Copy link
Member

xabbuh commented Sep 21, 2014

👍 I like it the way it is now!

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.

3 participants