From 35482563e5fc3491254120dd2f4faa778bfadfff Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 12 Oct 2025 01:33:48 -0500 Subject: try new names --- argv.go | 9 ++++++--- exit.go | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/argv.go b/argv.go index 1ab7dda..51bad78 100644 --- a/argv.go +++ b/argv.go @@ -209,11 +209,14 @@ func (args) Examples() string { return out } -func (a args) DoAutoComplete(pb *prep.Auto) { +// sends the strings to bash or zsh that will be your options +func (a args) SendCompletionStrings(pb *prep.Auto) { if pb.Cmd == "" { - pb.Autocomplete3([]string{"checkout", "clean", "commit", "gui", "merge", "mode", "patch", "pull", "show", "add", "fixer", "--version", "--force", "dev", "normal", "--all"}) + // these are base autocomplete strings + pb.SendStrings([]string{"checkout", "clean", "commit", "gui", "merge", "mode", "patch", "pull", "show", "add", "fixer", "--version", "--force", "dev", "normal", "--all"}) } else { - pb.SubCommand(pb.Goargs...) + // autogenerate the strings for the subcommand using github.com/alexflint/go-arg + pb.GenerateSubCommandStrings(pb.Goargs...) } os.Exit(0) } diff --git a/exit.go b/exit.go index e0096e2..ae1ceac 100644 --- a/exit.go +++ b/exit.go @@ -9,6 +9,9 @@ import ( "go.wit.com/log" ) +// callback for bash autocomplete to shutdown +// forge properly before exiting back to the shell +// hopefully will allow the GUI plugins to unload properly func (args) Exit() { forgeShutdown() } -- cgit v1.2.3