Skip to content

Commit

Permalink
kairos-cli: use clap default_value
Browse files Browse the repository at this point in the history
  • Loading branch information
marijanp committed May 6, 2024
1 parent e63194d commit 987177d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kairos-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ use reqwest::Url;
pub struct Cli {
#[command(subcommand)]
pub command: Command,
#[arg(long, value_name = "URL")]
pub kairos_server_address: Option<Url>,
#[arg(long, value_name = "URL", default_value = "0.0.0.0:9999")]
pub kairos_server_address: Url,
}

#[derive(Subcommand)]
Expand All @@ -34,8 +34,6 @@ pub fn run(
kairos_server_address,
}: Cli,
) -> Result<String, CliError> {
let kairos_server_address =
kairos_server_address.unwrap_or(Url::parse("http://0.0.0.0:9999").unwrap());
match command {
Command::Deposit(args) => commands::deposit::run(args, kairos_server_address),
Command::Transfer(args) => commands::transfer::run(args),
Expand Down

0 comments on commit 987177d

Please sign in to comment.