Skip to content

Improve mimicry of Cobra completion - #11

Merged
nnutter merged 4 commits into
masterfrom
cobra-completion
Sep 23, 2026
Merged

nnutter merged 4 commits into
masterfrom
cobra-completion

Conversation

@nnutter

@nnutter nnutter commented Sep 23, 2026

Copy link
Copy Markdown
Owner

No description provided.

Mimic Cobra by printing the bash script to stdout, but just emit
complete -F _git roam since roam wraps git.

Reviewed-by: Nathan Nutter <nnutter@duck.com>
Reviewed-at: c6168cf67c2720ce643812a0089f13b1a4387f0f
Match Cobra by writing the script to stdout unless --out is
given, so users can source or redirect it. Keep the file write
with --force when --out is set.
Move the bash command construction out of completionCommand
so each shell lives in its own file.
Move the zsh command with its file helpers and embedded
script out of completion.go, leaving only the parent command.

Reviewed-by: Nathan Nutter <nnutter@duck.com>
Reviewed-at: e2d7935505519e1624996ad75be41d577baea07c
@nnutter
nnutter enabled auto-merge September 23, 2026 21:03
@nnutter
nnutter merged commit 06beb08 into master Sep 23, 2026
3 checks passed
@nnutter
nnutter deleted the cobra-completion branch September 23, 2026 21:04
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