Skip to content

test(cli): cover noun-first list aliases#115

Draft
overtrue wants to merge 1 commit intomainfrom
codex/noun-first-list-alias-gap
Draft

test(cli): cover noun-first list aliases#115
overtrue wants to merge 1 commit intomainfrom
codex/noun-first-list-alias-gap

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Summary

This adds focused parser coverage for the noun-first ls aliases introduced with the recent bucket/object command groups.

Problem

The command-group work in #76 added bucket and object entrypoints with ls as an alias for list, but the parser tests in crates/cli/src/commands/mod.rs did not assert those alias routes. That left a small regression window where the alias wiring could drift without a fast unit test catching it.

Root cause

Existing parser coverage around the noun-first surface focused on bucket cors and other follow-up gaps, but not on the ls aliases attached directly to BucketCommands::List and ObjectCommands::List.

Fix

The patch keeps scope tight to crates/cli/src/commands/mod.rs:

  • add cli_accepts_bucket_list_alias for rc bucket ls local/
  • add cli_accepts_object_list_alias for rc object ls local/my-bucket/logs/

Both assertions verify clap dispatch reaches the expected noun-first command variants and preserves the parsed path.

Validation

I ran:

  • cargo test -p rustfs-cli cli_accepts_bucket_list_alias --lib -- --nocapture
  • cargo test -p rustfs-cli cli_accepts_object_list_alias --lib -- --nocapture
  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

I also ran make pre-commit per the automation instructions, but this checkout does not define that target:

make: *** No rule to make target `pre-commit'.  Stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant