Skip to content

feat(completions): add safe user-level install - #313

Merged
cxymds merged 2 commits into
mainfrom
cxymds/feat-completion-install
Jul 24, 2026
Merged

feat(completions): add safe user-level install#313
cxymds merged 2 commits into
mainfrom
cxymds/feat-completion-install

Conversation

@cxymds

@cxymds cxymds commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

  • add optional --install support to rc completions
  • choose shell-specific user completion paths with XDG-aware defaults
  • preserve existing scripts unless the user explicitly passes --force
  • install through a temporary file in the destination directory for atomic replacement
  • document default paths and custom --install-dir usage

Why

Completion generation already exists, but users must manually discover the correct location and install the generated script. This implements the completion-install slice of rustfs/backlog#1382 while keeping stdout generation unchanged.

User impact

Users can run rc completions <shell> --install. Existing files are never overwritten implicitly; --force is required to replace them.

BREAKING change assessment

BREAKING: no. This only adds optional flags; the existing rc completions <shell> stdout behavior is unchanged. The marker is included because this PR updates the protected command reference documentation.

Validation

  • cargo fmt --check
  • cargo test -p rustfs-cli commands::completions::tests (7 tests in each CLI target)
  • cargo clippy -p rustfs-cli --all-targets -- -D warnings
  • command smoke test covering first install, refused overwrite, and forced replacement

Closes rustfs/backlog#1484
Refs rustfs/backlog#1382

@cxymds
cxymds marked this pull request as ready for review July 24, 2026 11:38
@cxymds
cxymds merged commit 15c701a into main Jul 24, 2026
17 checks passed
@cxymds
cxymds deleted the cxymds/feat-completion-install branch July 24, 2026 12:03
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