-
Notifications
You must be signed in to change notification settings - Fork 931
Allow --validator-dir to be specified after subcommands #8329
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
base: unstable
Are you sure you want to change the base?
Conversation
|
There is a CI check that fails. May not be related to your change, maybe need to update to latest unstable, can you fix it? Thanks |
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.
While this PR is a 1-line change in the main code, I think the PR has merits in the test file change, as commented below.
Putting a note here that this change will be replaced by the clap derive migration PR #6493, where we can add a global = true here cc @eserilev
I have tested in both cases and it works
|
|
||
| let validator_import_key_cmd = || { | ||
| validator_cmd() | ||
| .arg(IMPORT_CMD) |
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.
This change is good, as it moves the subcommand import (and other subcommands) to before the --validator-dir flag.
The test will only pass with the change in mod.rs to add .global(true) to allow subcommands such as import be placed before the --valdiator-dir
| "The path to search for validator directories. \ | ||
| Defaults to ~/.lighthouse/{network}/validators", | ||
| ) | ||
| .global(true) |
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.
I am not sure if there is a better way than adding .global(true) here, because the --validator-dir flag is defined before the subcommands import, create etc. So I think adding a global here is fine.
Issue Addressed
#3768
Proposed Changes
Made the --validator-dir flag global so that it can be specified in any order
Additional Info
Please provide any additional information. For example, future considerations
or information useful for reviewers.