Cleanup redundant code in App/Command#1498
Merged
dearchap merged 13 commits intourfave:mainfrom Oct 14, 2022
Merged
Conversation
c4780b8 to
748ea87
Compare
dab5f01 to
adcce13
Compare
meatballhat
requested changes
Oct 10, 2022
Member
|
fwiw the https://github.com/urfave/cli/actions/runs/3215687734/jobs/5256958204#step:7:244 |
meatballhat
reviewed
Oct 10, 2022
meatballhat
previously approved these changes
Oct 14, 2022
Co-authored-by: Dan Buch <dan@meatballhat.com>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
(REQUIRED)
What this PR does / why we need it:
(REQUIRED)
Current code path requires almost similar code is three separate places. App.RunContext, App.RunAsSubcommand, and Command.Run. Any bug in flag handling/help etc would need changes in all these places. To make it more manageable the proposal is to condense it into a single place in Command.Run. To enable this we simulate the main App instance as a "rootCommand".
This is a draft proposal. It still requires some work to have all unit tests pass but I wanted some buy in from the community
Which issue(s) this PR fixes:
(REQUIRED)
Fixes #554
Special notes for your reviewer:
(fill-in or delete this section)
Testing
(fill-in or delete this section)
Release Notes
(REQUIRED)