diff --git a/Cargo.toml b/Cargo.toml index caa051d..7c99f2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ async-trait = "0.1.68" auto_impl = "1.1.0" cairo-starknet-2-0-1 = { package = "cairo-lang-starknet", version = "=2.0.1" } chrono = "0.4.26" -clap = { version = "4.3.8", features = ["derive", "env"] } +clap = { version = "4.3.8", features = ["derive", "env", "string"] } clap_complete = "4.3.1" colored = "2.0.0" colored_json = "3.2.0" diff --git a/src/signer.rs b/src/signer.rs index d194827..6ea36d5 100644 --- a/src/signer.rs +++ b/src/signer.rs @@ -28,7 +28,7 @@ pub enum AnySignerSignError { #[derive(Debug, Clone, Parser)] pub struct SignerArgs { - #[clap(long, help = "Path to keystore JSON file")] + #[clap(long, help = keystore_help())] keystore: Option, #[clap( long, @@ -141,3 +141,10 @@ impl SignerArgs { Ok(AnySigner::LocalWallet(LocalWallet::from_signing_key(key))) } } + +fn keystore_help() -> String { + format!( + "Path to keystore JSON file [env: STARKNET_KEYSTORE={}]", + std::env::var("STARKNET_KEYSTORE").unwrap_or_default() + ) +}