From d7b8e423edae12489f8e341438ba61bb458dea9b Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 17 Oct 2025 15:43:06 -0500 Subject: code for argv PB moved to a more standard location --- argv.go | 10 ++++++---- main.go | 4 ++-- structs.go | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/argv.go b/argv.go index e1756cc..1ac80c9 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" ) /* @@ -25,7 +25,7 @@ type EmptyCmd struct { } func (args) Version() string { - return ARGNAME + " " + VERSION + " Built on " + BUILDTIME + return argvpb.StandardVersion(ARGNAME, VERSION, BUILDTIME) } func (args) Buildtime() (string, string) { @@ -36,9 +36,11 @@ func (args) Appname() string { return ARGNAME } -func (a args) DoAutoComplete(pb *prep.Auto) { +// 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{"test", "--version", "--force"}) + base := []string{"test", "--version", "--force"} + pb.SendStrings(base) } else { pb.SubCommand(pb.Goargs...) } diff --git a/main.go b/main.go index a5da179..7b00bb2 100644 --- a/main.go +++ b/main.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - "go.wit.com/lib/gui/prep" + "go.wit.com/lib/protobuf/argvpb" "go.wit.com/lib/protobuf/forgepb" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" @@ -34,7 +34,7 @@ var LIBDIR string = "/var/lib/gowebd/" 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 if argv.RepoMap != "" { REPOMAP = argv.RepoMap diff --git a/structs.go b/structs.go index af1e4a1..d546363 100644 --- a/structs.go +++ b/structs.go @@ -4,7 +4,7 @@ package main import ( - "go.wit.com/lib/gui/prep" + "go.wit.com/lib/protobuf/argvpb" "go.wit.com/lib/protobuf/forgepb" ) @@ -12,6 +12,6 @@ var me *mainType // this app's variables type mainType struct { - sh *prep.Auto // shell autocomplete + sh *argvpb.Argv // shell autocomplete forge *forgepb.Forge // for holding the forge protobuf files } -- cgit v1.2.3