Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions crates/cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,4 +472,20 @@ mod tests {
other => panic!("expected bucket command, got {:?}", other),
}
}

#[test]
fn cli_accepts_object_stat_subcommand() {
let cli = Cli::try_parse_from(["rc", "object", "stat", "local/my-bucket/report.json"])
.expect("parse object stat");

match cli.command {
Commands::Object(args) => match args.command {
object::ObjectCommands::Stat(arg) => {
assert_eq!(arg.path, "local/my-bucket/report.json");
}
other => panic!("expected object stat command, got {:?}", other),
},
other => panic!("expected object command, got {:?}", other),
}
}
}
10 changes: 10 additions & 0 deletions crates/cli/tests/help_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,16 @@ fn nested_subcommand_help_contract() {
usage: "Usage: rc object show [OPTIONS] <PATH>",
expected_tokens: &["--enc-key", "--rewind", "--version-id"],
},
HelpCase {
args: &["object", "stat"],
usage: "Usage: rc object stat [OPTIONS] <PATH>",
expected_tokens: &["--version-id", "--rewind"],
},
HelpCase {
args: &["object", "share"],
usage: "Usage: rc object share [OPTIONS] <PATH>",
expected_tokens: &["--expire", "--upload", "--content-type"],
},
HelpCase {
args: &["admin", "user", "info"],
usage: "Usage: rc admin user info [OPTIONS] <ALIAS> <ACCESS_KEY>",
Expand Down