Skip to content

fix zsh completion - #659

Merged
creativeprojects merged 2 commits into
masterfrom
zsh-completion-fix-array
Jun 28, 2026
Merged

creativeprojects merged 2 commits into
masterfrom
zsh-completion-fix-array

Conversation

@creativeprojects

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 28, 2026 15:34
@creativeprojects creativeprojects added the bug Something isn't working label Jun 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes zsh completion argument handling so multi-word command lines are passed to resticprofile complete as distinct arguments (preventing zsh from joining slices into a single token), and adds integration tests to prevent regressions.

Changes:

  • Update zsh completion to use ${(@)words[2,-1]} when invoking resticprofile complete, preserving word boundaries.
  • Update restic-delegation argument rebuilding to iterate over ${(@)words[2,-1]} as separate words.
  • Add zsh shell-completion integration tests covering flags after a built-in command and after a prefixed delegated subcommand.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
contrib/completion/zsh-completion.zsh Ensures zsh passes the words slice as separate argv entries to resticprofile complete, fixing completion for flags after subcommands.
completion_shell_test.go Adds zsh integration tests that exercise multi-word completion paths (built-in and restic-delegated).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread contrib/completion/zsh-completion.zsh
Comment thread completion_shell_test.go
@codecov

codecov Bot commented Jun 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 54.54545% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.93%. Comparing base (17f5c43) to head (f8681d9).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
complete.go 37.50% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #659      +/-   ##
==========================================
- Coverage   80.96%   80.93%   -0.03%     
==========================================
  Files         162      162              
  Lines       12122    12131       +9     
==========================================
+ Hits         9814     9818       +4     
- Misses       1810     1814       +4     
- Partials      498      499       +1     
Flag Coverage Δ
unittests 79.21% <54.55%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@creativeprojects
creativeprojects merged commit 9eac2a8 into master Jun 28, 2026
12 of 13 checks passed
@creativeprojects
creativeprojects deleted the zsh-completion-fix-array branch June 28, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants