From 3c096fec0f341f88fa614ef72b05a849e59a3cf3 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 21 Sep 2025 11:22:04 -0500 Subject: [PATCH] rename files --- bash.new.go => complete.go | 0 bash.Completion.go => shell.go | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) rename bash.new.go => complete.go (100%) rename bash.Completion.go => shell.go (83%) diff --git a/bash.new.go b/complete.go similarity index 100% rename from bash.new.go rename to complete.go diff --git a/bash.Completion.go b/shell.go similarity index 83% rename from bash.Completion.go rename to 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 "$@" + +*/