From f63123ba2326b9b78b3762b856713b8dc643789b Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 17 Oct 2025 17:18:52 -0500 Subject: lib now with better name --- 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 58a7f2b..328da54 100644 --- a/argv.go +++ b/argv.go @@ -11,7 +11,7 @@ package main import ( "os" - "go.wit.com/lib/gui/prep" + "go.wit.com/lib/protobuf/argvpb" "go.wit.com/log" ) @@ -50,7 +50,7 @@ func init() { } func (args) Version() string { - return ARGNAME + " " + VERSION + " Built on " + BUILDTIME + return argvpb.StandardVersion(ARGNAME, VERSION, BUILDTIME) } func (args) Buildtime() (string, string) { @@ -61,9 +61,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{"status", "test", "--version", "--daemon"}) + base := []string{"status", "test", "--version", "--daemon"} + pb.SendStrings(base) } else { pb.SubCommand(pb.Goargs...) } diff --git a/main.go b/main.go index 9420f63..2ab076e 100644 --- a/main.go +++ b/main.go @@ -10,8 +10,8 @@ import ( "time" "go.wit.com/lib/debian" - "go.wit.com/lib/gui/prep" "go.wit.com/lib/hostname" + "go.wit.com/lib/protobuf/argvpb" "go.wit.com/lib/protobuf/zoopb" "go.wit.com/log" ) @@ -28,7 +28,7 @@ var resources embed.FS func main() { me = new(zoodStruct) - me.sh = prep.Bash(&argv) // adds shell auto complete to go-args + me.sh = argvpb.Autocomplete(&argv) // adds shell auto complete to go-args if argv.Daemon { // turn off timestamps for STDOUT (systemd adds them) diff --git a/structs.go b/structs.go index d28c5bf..d3bd152 100644 --- a/structs.go +++ b/structs.go @@ -6,7 +6,7 @@ package main import ( "time" - "go.wit.com/lib/gui/prep" + "go.wit.com/lib/protobuf/argvpb" "go.wit.com/lib/protobuf/zoopb" ) @@ -14,7 +14,7 @@ var me *zoodStruct // this app's variables type zoodStruct struct { - sh *prep.Auto // shell autocomplete + sh *argvpb.Argv // shell autocomplete urlbase string // the dns name for the zookeeper hostname string // my hostname pollDelay time.Duration // how often to report our status -- cgit v1.2.3