mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 11:52:42 +00:00
* 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
25 lines
608 B
Rust
25 lines
608 B
Rust
use crate::WALLETS_DIR_FLAG;
|
|
use clap::Command;
|
|
use eth2_wallet_manager::WalletManager;
|
|
use std::path::PathBuf;
|
|
|
|
pub const CMD: &str = "list";
|
|
|
|
pub fn cli_app() -> Command {
|
|
Command::new(CMD).about("Lists the names of all wallets.")
|
|
}
|
|
|
|
pub fn cli_run(wallet_base_dir: PathBuf) -> Result<(), String> {
|
|
let mgr = WalletManager::open(wallet_base_dir)
|
|
.map_err(|e| format!("Unable to open --{}: {:?}", WALLETS_DIR_FLAG, e))?;
|
|
|
|
for (name, _uuid) in mgr
|
|
.wallets()
|
|
.map_err(|e| format!("Unable to list wallets: {:?}", e))?
|
|
{
|
|
println!("{}", name)
|
|
}
|
|
|
|
Ok(())
|
|
}
|