diff options
| author | Jeff Carr <[email protected]> | 2025-10-17 16:29:45 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-17 16:29:45 -0500 | 
| commit | e4f3c02a6f97810aa69a85e81a994c12b33a8ca8 (patch) | |
| tree | 51141336fda0e0a9e65ad13abb3594b64643c80e | |
| parent | c9e79a11c7caeabc8a6f7b2d2217a3af80c4797c (diff) | |
renamed lib to argvpb
| -rw-r--r-- | argv.go | 16 | ||||
| -rw-r--r-- | main.go | 5 | ||||
| -rw-r--r-- | structs.go | 16 | 
3 files changed, 19 insertions, 18 deletions
@@ -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...)  	} @@ -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() @@ -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  }  | 
