From e4f3c02a6f97810aa69a85e81a994c12b33a8ca8 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 17 Oct 2025 16:29:45 -0500 Subject: renamed lib to argvpb --- argv.go | 16 +++++++++------- main.go | 5 ++--- structs.go | 16 ++++++++-------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/argv.go b/argv.go index ac5e3eb..6d9e4ba 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" ) var argv args @@ -37,10 +37,6 @@ type args struct { type EmptyCmd struct { } -func (args) Version() string { - return ARGNAME + " " + VERSION + " Built on " + BUILDTIME -} - /* handles shell autocomplete */ @@ -53,9 +49,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{"drives", "gui", "--version"}) + base := []string{"drives", "gui", "--version"} + pb.SendStrings(base) } else { pb.SubCommand(pb.Goargs...) } diff --git a/main.go b/main.go index 2351110..81033dc 100644 --- a/main.go +++ b/main.go @@ -12,7 +12,7 @@ import ( "plugin" "unicode" - "go.wit.com/lib/gui/prep" + "go.wit.com/lib/protobuf/argvpb" "go.wit.com/log" ) @@ -28,8 +28,7 @@ var resources embed.FS func main() { me = new(autoType) - me.myGui = prep.Gui() // prepares the GUI package for go-args - me.auto = prep.Bash3(&argv) // add support for bash autocomplete with go-arg + me.argv = argvpb.Autocomplete(&argv) // adds shell auto complete to go-args me.pb = NewBlocks() diff --git a/structs.go b/structs.go index f978f24..e40c8a9 100644 --- a/structs.go +++ b/structs.go @@ -5,18 +5,18 @@ package main import ( "go.wit.com/gui" - "go.wit.com/lib/gui/prep" + "go.wit.com/lib/protobuf/argvpb" ) var me *autoType // this app's variables type autoType struct { - auto *prep.Auto // more experiments for bash handling - myGui *prep.GuiPrep // the gui toolkit handle - dd *gui.Node // the drives dropdown list - parted *gui.Node // the current drive to run parted on - currentDev *Block // the current dev entry to work on - pb *Blocks // the block dev protobuf - driveInfoBox *gui.Node // displays the drive info + argv *argvpb.Argv // shell autocomplete + myGui *argvpb.GuiPrep // the gui toolkit handle + dd *gui.Node // the drives dropdown list + parted *gui.Node // the current drive to run parted on + currentDev *Block // the current dev entry to work on + pb *Blocks // the block dev protobuf + driveInfoBox *gui.Node // displays the drive info } -- cgit v1.2.3