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

upgrade clap to v4.5 #5273

Merged
merged 58 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3b8fd4a
upgrade clap to v4.5
eserilev Feb 20, 2024
1de4880
cli fixes
eserilev Feb 22, 2024
4743a2c
Merge branch 'unstable' of https://github.com/sigp/lighthouse into up…
eserilev Feb 22, 2024
e05b856
value parser for mnemonic
eserilev Feb 24, 2024
b34b11d
Merge branch 'unstable' of https://github.com/sigp/lighthouse into up…
eserilev Mar 12, 2024
c3d6ede
merge unstable
eserilev Mar 12, 2024
acc8c6d
default --format val
eserilev Mar 12, 2024
1f45d1f
fix eth sim
eserilev Mar 13, 2024
f4447b7
fix eth sim
eserilev Mar 13, 2024
88f083a
merge conflicts
eserilev Apr 2, 2024
d00855e
resolve beta compiler issue
eserilev Apr 2, 2024
7b558bd
add num args, version
eserilev Apr 3, 2024
7b50109
add custom flag parser, make rate limiter flags clap friendly
eserilev Apr 3, 2024
fb3b8dd
remove unneeded check
eserilev Apr 3, 2024
9b40a14
fmt
eserilev Apr 3, 2024
e320c99
update
eserilev Apr 4, 2024
0c92aaa
alphabetic order
eserilev Apr 4, 2024
f6653b0
resolve merge conflict
eserilev Apr 4, 2024
30556d0
fix test
eserilev Apr 4, 2024
0dd6423
resolve conflicts
eserilev Apr 4, 2024
71edfe8
fix test
eserilev Apr 4, 2024
4555fb2
revert removed if statement
eserilev Apr 4, 2024
35bdf5e
fmt got me again
eserilev Apr 4, 2024
daec018
fix broken flag
eserilev Apr 5, 2024
8911e3c
make cli
eserilev Apr 5, 2024
e4a4b88
make cli
eserilev Apr 8, 2024
71ff732
update
eserilev Apr 9, 2024
9de4980
remove -e files
eserilev Apr 9, 2024
51c4419
update
eserilev Apr 9, 2024
a4c4bb5
cli help updates
realbigsean Apr 10, 2024
ebdc22b
Merge branch 'unstable' of https://github.com/sigp/lighthouse into up…
realbigsean Apr 10, 2024
568bf79
cli help updates
realbigsean Apr 10, 2024
75c2c72
md files
eserilev Apr 12, 2024
d19c9e7
merge conflict
eserilev Apr 12, 2024
0a624c9
merge conflicts
eserilev Apr 12, 2024
e23b96b
md
eserilev Apr 12, 2024
7f4af13
help text, text width, and a few flag fixes
eserilev Apr 15, 2024
bd4e5c9
fmt
eserilev Apr 15, 2024
fa7c4b3
merge
eserilev Apr 25, 2024
f5f114f
revert
eserilev Apr 25, 2024
ac451a8
revert
eserilev Apr 25, 2024
de33110
resolve merge conflicts
eserilev Apr 26, 2024
c6b9712
merge conflicts
eserilev Apr 26, 2024
6a81d12
revert simulator changes
eserilev Apr 27, 2024
b8bea91
require at least one arg
eserilev Apr 27, 2024
be90ac7
fix eth sim cli
eserilev Apr 30, 2024
82d1bc3
resolve merge conflicts
eserilev May 12, 2024
c5a3058
book changes
eserilev May 12, 2024
0be7b71
md changes
eserilev May 14, 2024
f8a8536
cli check
eserilev May 14, 2024
61da93f
cli check
eserilev May 14, 2024
3c26b9a
retry cli check
eserilev May 14, 2024
8180839
retry cli check
eserilev May 14, 2024
aa4334f
Merge branch 'unstable' of https://github.com/sigp/lighthouse into up…
eserilev May 20, 2024
9a39467
cli
eserilev May 20, 2024
c54e39a
Merge remote-tracking branch 'origin/unstable' into upgrade-clap-cli
michaelsproul May 27, 2024
5e0f2df
Update CLI docs for Goerli removal
michaelsproul May 28, 2024
23b0c70
Fix cargo lock
michaelsproul May 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 111 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ bincode = "1"
bitvec = "1"
byteorder = "1"
bytes = "1"
clap = { version = "4.5.4", features = ["cargo", "wrap_help"] }
# Turn off c-kzg's default features which include `blst/portable`. We can turn on blst's portable
# feature ourselves when desired.
c-kzg = { version = "1", default-features = false }
clap = "2"
c-kzg = { version = "1", default-features = false }
compare_fields_derive = { path = "common/compare_fields_derive" }
criterion = "0.3"
delay_map = "0.3"
Expand Down
30 changes: 22 additions & 8 deletions account_manager/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ mod common;
pub mod validator;
pub mod wallet;

use clap::App;
use clap::Arg;
use clap::ArgAction;
use clap::ArgMatches;
use clap::Command;
use clap_utils::FLAG_HEADER;
use environment::Environment;
use types::EthSpec;

Expand All @@ -13,25 +16,36 @@ pub const VALIDATOR_DIR_FLAG: &str = "validator-dir";
pub const VALIDATOR_DIR_FLAG_ALIAS: &str = "validators-dir";
pub const WALLETS_DIR_FLAG: &str = "wallets-dir";

pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
App::new(CMD)
.visible_aliases(&["a", "am", "account", CMD])
pub fn cli_app() -> Command {
Command::new(CMD)
.visible_aliases(["a", "am", "account", CMD])
.about("Utilities for generating and managing Ethereum 2.0 accounts.")
.display_order(0)
.arg(
Arg::new("help")
.long("help")
.short('h')
.help("Prints help information")
.action(ArgAction::HelpLong)
.display_order(0)
.help_heading(FLAG_HEADER),
)
.subcommand(wallet::cli_app())
.subcommand(validator::cli_app())
}

/// Run the account manager, returning an error if the operation did not succeed.
pub fn run<E: EthSpec>(matches: &ArgMatches<'_>, env: Environment<E>) -> Result<(), String> {
pub fn run<E: EthSpec>(matches: &ArgMatches, env: Environment<E>) -> Result<(), String> {
match matches.subcommand() {
(wallet::CMD, Some(matches)) => wallet::cli_run(matches)?,
(validator::CMD, Some(matches)) => validator::cli_run(matches, env)?,
(unknown, _) => {
Some((wallet::CMD, matches)) => wallet::cli_run(matches)?,
Some((validator::CMD, matches)) => validator::cli_run(matches, env)?,
Some((unknown, _)) => {
return Err(format!(
"{} is not a valid {} command. See --help.",
unknown, CMD
));
}
_ => return Err("No subcommand provided, see --help for options".to_string()),
}

Ok(())
Expand Down
Loading
Loading