Skip to content

Commit

Permalink
feat: mention STARKNET_KEYSTORE in help text
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Jul 16, 2023
1 parent 3456a79 commit ddfb5aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 8 additions & 1 deletion src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
#[clap(
long,
Expand Down Expand Up @@ -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()
)
}

0 comments on commit ddfb5aa

Please sign in to comment.