mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 21:34:46 +00:00
upgrade clap to v4.5 (#5273)
* upgrade clap to v4.5 * cli fixes * Merge branch 'unstable' of https://github.com/sigp/lighthouse into upgrade-clap-cli * value parser for mnemonic * Merge branch 'unstable' of https://github.com/sigp/lighthouse into upgrade-clap-cli * merge unstable * default --format val * fix eth sim * fix eth sim * merge conflicts * resolve beta compiler issue * add num args, version * add custom flag parser, make rate limiter flags clap friendly * remove unneeded check * fmt * update * alphabetic order * resolve merge conflict * fix test * resolve conflicts * fix test * revert removed if statement * fmt got me again * fix broken flag * make cli * make cli * update * remove -e files * update * cli help updates * Merge branch 'unstable' of https://github.com/sigp/lighthouse into upgrade-clap-cli * cli help updates * md files * merge conflict * merge conflicts * md * help text, text width, and a few flag fixes * fmt * merge * revert * revert * resolve merge conflicts * merge conflicts * revert simulator changes * require at least one arg * fix eth sim cli * resolve merge conflicts * book changes * md changes * cli check * cli check * retry cli check * retry cli check * Merge branch 'unstable' of https://github.com/sigp/lighthouse into upgrade-clap-cli * cli * Merge remote-tracking branch 'origin/unstable' into upgrade-clap-cli * Update CLI docs for Goerli removal * Fix cargo lock
This commit is contained in:
@@ -31,8 +31,12 @@ pub fn run_parse_ssz<E: EthSpec>(
|
||||
network_config: Eth2NetworkConfig,
|
||||
matches: &ArgMatches,
|
||||
) -> Result<(), String> {
|
||||
let type_str = matches.value_of("type").ok_or("No type supplied")?;
|
||||
let filename = matches.value_of("ssz-file").ok_or("No file supplied")?;
|
||||
let type_str = matches
|
||||
.get_one::<String>("type")
|
||||
.ok_or("No type supplied")?;
|
||||
let filename = matches
|
||||
.get_one::<String>("ssz-file")
|
||||
.ok_or("No file supplied")?;
|
||||
let format = parse_required(matches, "format")?;
|
||||
|
||||
let bytes = if filename.ends_with("ssz_snappy") {
|
||||
@@ -58,7 +62,7 @@ pub fn run_parse_ssz<E: EthSpec>(
|
||||
|
||||
// More fork-specific decoders may need to be added in future, but shouldn't be 100% necessary,
|
||||
// as the fork-generic decoder will always be available (requires correct --network flag).
|
||||
match type_str {
|
||||
match type_str.as_str() {
|
||||
"SignedBeaconBlock" => decode_and_print::<SignedBeaconBlock<E>>(
|
||||
&bytes,
|
||||
|bytes| SignedBeaconBlock::from_ssz_bytes(bytes, spec),
|
||||
|
||||
Reference in New Issue
Block a user