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

Skip to content

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 rliebz and saschagrunert 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.

3 participants