diff options
| author | Jeff Carr <[email protected]> | 2025-09-21 11:22:04 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-21 11:22:04 -0500 |
| commit | 3c096fec0f341f88fa614ef72b05a849e59a3cf3 (patch) | |
| tree | c2aa8d9084448a7263dc715d140a07e226a44082 | |
| parent | 16d7cb2696fdad119fb58cadd6f2220ba8c7aad5 (diff) | |
rename filesv0.0.9
| -rw-r--r-- | complete.go (renamed from bash.new.go) | 0 | ||||
| -rw-r--r-- | shell.go (renamed from bash.Completion.go) | 28 |
2 files changed, 28 insertions, 0 deletions
diff --git a/bash.new.go b/complete.go index dee60c5..dee60c5 100644 --- a/bash.new.go +++ b/complete.go diff --git a/bash.Completion.go b/shell.go index e0eb965..212c935 100644 --- a/bash.Completion.go +++ b/shell.go @@ -73,3 +73,31 @@ func makeBashCompletionText2(argname string) string { out += fmt.Sprintf("# copy and paste the above into your bash shell should work\n") return out } + +// zsh: +/* +#compdef forge + +# Zsh completion function for the 'forge' command. + +_forge_completions() { + local -a words + local -i CURRENT + + # Zsh's equivalent of Bash's COMP_WORDS and COMP_CWORD + words=("${(@)words}") + CURRENT=$CURRENT + + # Generate the completion suggestions by calling the forge command. + # The output is split into an array. + local -a suggestions + suggestions=("${(@f)$(forge --auto-complete "'${words[CURRENT]}'" "${words[@]}")}") + + # Pass the suggestions to the Zsh completion system. + _describe 'completions' suggestions +} + +# Register the function to be called for the 'forge' command. +_forge_completions "$@" + +*/ |
