Skip to content

Commit

Permalink
Add CASPER_NODE_ADDRESS env var.
Browse files Browse the repository at this point in the history
This makes it easier to use multiple commands without remembering to set
`--node-address`. With this change casper-client will try to load its
value from env variable `CASPER_NODE_ADDRESS`.
  • Loading branch information
mpapierski committed Jun 18, 2024
1 parent 6b61f16 commit f82203a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async-trait = { version = "0.1.74", optional = true }
base16 = "0.2.1"
casper-hashing = "3.0.0"
casper-types = { version = "4.0.1", features = ["std"] }
clap = { version = "~4.4", optional = true, features = ["cargo", "deprecated", "wrap_help"] }
clap = { version = "~4.4", optional = true, features = ["cargo", "deprecated", "wrap_help", "env"] }
clap_complete = { version = "<4.5.0", optional = true }
hex-buffer-serde = "0.4.0"
humantime = "2.1.0"
Expand Down
1 change: 1 addition & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ pub mod node_address {
Arg::new(ARG_NAME)
.long(ARG_NAME)
.short(ARG_SHORT)
.env("CASPER_NODE_ADDRESS")
.required(false)
.default_value(ARG_DEFAULT)
.value_name(ARG_VALUE_NAME)
Expand Down

0 comments on commit f82203a

Please sign in to comment.