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

adding optional msg parameter to \cli\Progress\Bar::tick() #126

Merged
merged 3 commits into from Mar 12, 2018

Conversation

2 participants
@lf-jeremy
Contributor

lf-jeremy commented Mar 5, 2018

As discussed in #125

The tick method of \cli\Notify::tick() is augmented in its grandchild class, \cli\Progress\Bar to have an optional second parameter which updates its _message property. As items are processed, the message may be optionally changed to reflect the nature of the work being performed.

The current behavior of the progress bar suppresses any output until the first tick occurs. In use cases where the developer wishes to display the initial message and then alter it during the first tick, they should manually call the public display() method of the progress bar before work is performed and the tick occurs.

The use case of displaying a message describing work about to be performed would be better served by supplementing this updated tick() method with a setter for the _message property whereby the message is manually changed before work is performed, then the tick is used to increment progress separately.

@schlessera schlessera merged commit e4cb9fd into wp-cli:master Mar 12, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@schlessera

This comment has been minimized.

Show comment
Hide comment
@schlessera

schlessera Mar 12, 2018

Member

Thanks for the pull request!

Member

schlessera commented Mar 12, 2018

Thanks for the pull request!

@schlessera schlessera added this to the 0.11.9 milestone Mar 12, 2018

@lf-jeremy

This comment has been minimized.

Show comment
Hide comment
@lf-jeremy

lf-jeremy Mar 12, 2018

Contributor

Thanks for your involvement, @schlessera. This probably calls for updating the progress bar documentation as well. Appreciate the collaboration!

Contributor

lf-jeremy commented Mar 12, 2018

Thanks for your involvement, @schlessera. This probably calls for updating the progress bar documentation as well. Appreciate the collaboration!

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