mirror of
https://github.com/Dangoware/confetti-box.git
synced 2025-04-19 15:22:57 -05:00
Updated CLI Set URL (#6)
* Updated CLI Set URL imu set --url now will default to https:// if nothing is provided * fixed an oops * requested change
This commit is contained in:
parent
710552fc1f
commit
4c4698ed8e
1 changed files with 7 additions and 2 deletions
|
@ -53,7 +53,7 @@ enum Commands {
|
||||||
/// Set the password for a server which requires login
|
/// Set the password for a server which requires login
|
||||||
#[arg(short, long, required = false)]
|
#[arg(short, long, required = false)]
|
||||||
password: Option<String>,
|
password: Option<String>,
|
||||||
/// Set the URL of the server to connect to
|
/// Set the URL of the server to connect to (assumes https://)
|
||||||
#[arg(long, required = false)]
|
#[arg(long, required = false)]
|
||||||
url: Option<String>,
|
url: Option<String>,
|
||||||
/// Set the directory to download into by default
|
/// Set the directory to download into by default
|
||||||
|
@ -305,7 +305,12 @@ async fn main() -> Result<()> {
|
||||||
url
|
url
|
||||||
};
|
};
|
||||||
|
|
||||||
config.url = url.to_string();
|
if !url.starts_with("https://") && !url.starts_with("http://") {
|
||||||
|
config.url = ("https://".to_owned() + url).to_string();
|
||||||
|
} else {
|
||||||
|
config.url = url.to_string();
|
||||||
|
}
|
||||||
|
|
||||||
config.save().unwrap();
|
config.save().unwrap();
|
||||||
println!("URL set to \"{url}\"");
|
println!("URL set to \"{url}\"");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue