-
Notifications
You must be signed in to change notification settings - Fork 968
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
feat(cmd): pass Start options; add WithFlagSet option #2950
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2950 +/- ##
==========================================
- Coverage 51.43% 50.87% -0.56%
==========================================
Files 170 168 -2
Lines 10925 10937 +12
==========================================
- Hits 5619 5564 -55
- Misses 4807 4873 +66
- Partials 499 500 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personally would like to give this another refactor, which might be out of scope for this PR, unless this refactoring creates an external contract with what you are doing in celestia-da? Otherwise, this is a good first step to making it a bit nicer to work with, even if some of the indirection of what gets passed in and around is too clever for me, i think fix some of the ordering nits i made, and clarify if passing bridge.WithSubCommands is correct or not and lets roll
d06d37b
to
c7456f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #2936
This PR updates the
Start
command to accept a variadic number offuncs
which can be used to customise the command.This allows the caller to hook into and modify the command, for example to add a
PreRun
hook, as required forcelestia-da
.With this PR in place, the
celestia-da
requirement, which needs to add some required flags and add aPreRun
hook can be satisfied as:Ideally this can be applied for other commands
Init
,Auth
as well, but it's not required for the current requirement.