From 7abc658c20a143bef36e30ad34719776bbc7a505 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 17 Oct 2025 15:42:34 -0500 Subject: new argv location --- argv.go | 16 +++++++++------- main.go | 4 ++-- structs.go | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/argv.go b/argv.go index 270c877..a4453b5 100644 --- a/argv.go +++ b/argv.go @@ -3,7 +3,7 @@ package main import ( "os" - "go.wit.com/lib/gui/prep" + "go.wit.com/lib/protobuf/argvpb" ) /* @@ -33,10 +33,6 @@ func (args) Examples() string { return out } -func (args) Version() string { - return "go-clone " + VERSION + " Built on " + BUILDTIME -} - type EmptyCmd struct { } @@ -60,9 +56,15 @@ func (args) Buildtime() (string, string) { return BUILDTIME, VERSION } -func (a args) DoAutoComplete(pb *prep.Auto) { +func (args) Version() string { + return argvpb.StandardVersion(ARGNAME, VERSION, BUILDTIME) +} + +// sends the strings to bash or zsh that will be your options +func (a args) SendCompletionStrings(pb *argvpb.Argv) { if pb.Cmd == "" { - pb.Autocomplete3([]string{"dump", "gui", "show", "--version", "--keep-files", "--buildversion"}) + base := []string{"dump", "gui", "show", "--version", "--keep-files", "--buildversion"} + pb.SendStrings(base) } else { pb.SubCommand(pb.Goargs...) } diff --git a/main.go b/main.go index fed5a72..1c4c7d0 100644 --- a/main.go +++ b/main.go @@ -7,7 +7,7 @@ import ( "time" "go.wit.com/lib/debian" - "go.wit.com/lib/gui/prep" + "go.wit.com/lib/protobuf/argvpb" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/lib/protobuf/zoopb" "go.wit.com/log" @@ -25,7 +25,7 @@ var argv args func main() { me = new(mainType) - me.sh = prep.Autocomplete(&argv) // adds shell auto complete to go-args + me.sh = argvpb.Autocomplete(&argv) // adds shell auto complete to go-args me.pb = new(zoopb.Package) wd, err := os.Getwd() diff --git a/structs.go b/structs.go index 50023fb..24f90ad 100644 --- a/structs.go +++ b/structs.go @@ -4,7 +4,7 @@ import ( "go.wit.com/gui" "go.wit.com/lib/fhelp" "go.wit.com/lib/gadgets" - "go.wit.com/lib/gui/prep" + "go.wit.com/lib/protobuf/argvpb" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/lib/protobuf/zoopb" ) @@ -13,7 +13,7 @@ var me *mainType // this app's variables type mainType struct { - sh *prep.Auto // more experiments for bash handling + sh *argvpb.Argv // shell autocomplete myGui *fhelp.GuiPrep // the gui handle itself origGui *gui.Node // the gui handle itself pb *zoopb.Package // the .deb package protobuf -- cgit v1.2.3