diff --git a/crates/cli/src/commands/rm.rs b/crates/cli/src/commands/rm.rs index 5f1f76f..2b540cc 100644 --- a/crates/cli/src/commands/rm.rs +++ b/crates/cli/src/commands/rm.rs @@ -369,6 +369,10 @@ fn parse_rm_path(path: &str) -> Result<(String, String, String), String> { String::new() }; + if alias.is_empty() { + return Err("Alias name cannot be empty".to_string()); + } + if bucket.is_empty() { return Err("Bucket name cannot be empty".to_string()); } @@ -420,6 +424,11 @@ mod tests { assert!(parse_rm_path("").is_err()); } + #[test] + fn test_parse_rm_path_empty_alias() { + assert!(parse_rm_path("/mybucket/file.txt").is_err()); + } + #[test] fn test_delete_request_options_enable_force_delete_for_purge() { let args = RmArgs {