Skip to content
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

fix: Propagate App.Reader to subcommands #1225

Merged
merged 1 commit into from Jan 25, 2021
Merged

fix: Propagate App.Reader to subcommands #1225

merged 1 commit into from Jan 25, 2021

Conversation

Coderlane
Copy link
Contributor

What type of PR is this?

(REQUIRED)

  • bug
  • cleanup
  • documentation
  • feature

What this PR does / why we need it:

(REQUIRED)

This change copies the Reader set in App to the new App created for subcommands. This allows tests for subcommands to inject a reader, similar to first level commands. Previously, the reader for subcommands was reset to Stdin. I added a basic test to demonstrate the issue.

Which issue(s) this PR fixes:

(REQUIRED)

No issue yet

Testing

I added a test case that acts as a regression test.

Release Notes

(REQUIRED)

Propagate App.Reader to subcommands

This change copies the `Reader` set in `App` to the new `App` created for
subcommands. I've also added a basic test to demonstrate the issue.
@Coderlane Coderlane requested a review from a team as a code owner January 25, 2021 01:02
@Coderlane Coderlane requested review from saschagrunert and rliebz and removed request for a team January 25, 2021 01:02
Copy link
Member

@coilysiren coilysiren left a comment

Choose a reason for hiding this comment

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

Nice fix 💯

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

LGTM

@coilysiren coilysiren merged commit 44ec985 into urfave:master Jan 25, 2021
@Coderlane Coderlane deleted the command_reader branch January 26, 2021 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants