diff --git a/bin/oli/README.md b/bin/oli/README.md index ed1a409fb0e3..d1ea13d1fa06 100644 --- a/bin/oli/README.md +++ b/bin/oli/README.md @@ -72,8 +72,8 @@ For different services, you could find the configuration keys in the correspondi ### Example: use `oli` to upload file to AWS S3 ```text -$ oli cp ./update-ecs-loadbalancer.json s3://update-ecs-loadbalancer.json -$ oli ls s3:// +$ oli cp ./update-ecs-loadbalancer.json s3:/update-ecs-loadbalancer.json +$ oli ls s3:/ fleet.png update-ecs-loadbalancer.json ``` @@ -81,8 +81,8 @@ update-ecs-loadbalancer.json ### Example: use `oli` copy file from S3 to R2 ```text -$ oli cp s3://fleet.png r2://fleet.png -$ oli ls r2:// +$ oli cp s3:/fleet.png r2:/fleet.png +$ oli ls r2:/ fleet.png ``` diff --git a/bin/oli/src/commands/cat.rs b/bin/oli/src/commands/cat.rs index fa892be6680e..567ebf9f1cba 100644 --- a/bin/oli/src/commands/cat.rs +++ b/bin/oli/src/commands/cat.rs @@ -30,6 +30,7 @@ use crate::params::config::ConfigParams; pub struct CatCmd { #[command(flatten)] pub config_params: ConfigParams, + /// In the form of `:/`. #[arg()] pub target: String, } diff --git a/bin/oli/src/commands/cp.rs b/bin/oli/src/commands/cp.rs index ecadddfa010f..09d7e2d73f03 100644 --- a/bin/oli/src/commands/cp.rs +++ b/bin/oli/src/commands/cp.rs @@ -47,8 +47,10 @@ const PROGRESS_CHARS: &str = "#>-"; pub struct CopyCmd { #[command(flatten)] pub config_params: ConfigParams, + /// In the form of `:/`. #[arg()] pub source: String, + /// In the form of `:/`. #[arg()] pub destination: String, /// Copy objects recursively. diff --git a/bin/oli/src/commands/ls.rs b/bin/oli/src/commands/ls.rs index 3e7eb1026889..10050982936d 100644 --- a/bin/oli/src/commands/ls.rs +++ b/bin/oli/src/commands/ls.rs @@ -26,6 +26,7 @@ use crate::params::config::ConfigParams; pub struct LsCmd { #[command(flatten)] pub config_params: ConfigParams, + /// In the form of `:/`. #[arg()] pub target: String, /// List objects recursively. diff --git a/bin/oli/src/commands/rm.rs b/bin/oli/src/commands/rm.rs index 04bc258d48c9..5c38bf1a001e 100644 --- a/bin/oli/src/commands/rm.rs +++ b/bin/oli/src/commands/rm.rs @@ -25,6 +25,7 @@ use crate::params::config::ConfigParams; pub struct RmCmd { #[command(flatten)] pub config_params: ConfigParams, + /// In the form of `:/`. #[arg()] pub target: String, /// Remove objects recursively. diff --git a/bin/oli/src/commands/stat.rs b/bin/oli/src/commands/stat.rs index 8f1051f1a1c7..04cc2431bfca 100644 --- a/bin/oli/src/commands/stat.rs +++ b/bin/oli/src/commands/stat.rs @@ -29,6 +29,7 @@ use crate::params::config::ConfigParams; pub struct StatCmd { #[command(flatten)] pub config_params: ConfigParams, + /// In the form of `:/`. #[arg()] pub target: String, } diff --git a/bin/oli/src/config/mod.rs b/bin/oli/src/config/mod.rs index d15ea884a498..ec401f367488 100644 --- a/bin/oli/src/config/mod.rs +++ b/bin/oli/src/config/mod.rs @@ -147,7 +147,7 @@ impl Config { let location = Url::parse(s)?; if location.has_host() { - Err(anyhow!("Host part in a location is not supported."))?; + Err(anyhow!("Host part in a location is not supported. Hint: are you typing `://` instead of `:/`?"))?; } let profile_name = location.scheme(); @@ -338,7 +338,7 @@ enable_virtual_host_style = "on" let uri = "mys3://foo/1.txt"; let expected_msg = "Host part in a location is not supported."; match cfg.parse_location(uri) { - Err(e) if e.to_string() == expected_msg => Ok(()), + Err(e) if e.to_string().contains(expected_msg) => Ok(()), _ => Err(anyhow!( "Getting an message \"{}\" is expected when parsing {}.", expected_msg,