diff options
| author | Jeff Carr <[email protected]> | 2025-10-17 17:18:27 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-17 17:18:27 -0500 | 
| commit | 34015f3d4ee487efe329d0387458f609343c2f9f (patch) | |
| tree | 5f9b09170817a6b7c54c331322b1ff09a6882fc6 | |
| parent | 686c7f0bd6a69580e2c1503c89cc21c1881d368a (diff) | |
new name 'argvpb'
| -rw-r--r-- | argv.go | 19 | ||||
| -rw-r--r-- | main.go | 4 | ||||
| -rw-r--r-- | structs.go | 7 | 
3 files changed, 15 insertions, 15 deletions
@@ -3,8 +3,7 @@ package main  import (  	"os" -	"go.wit.com/lib/fhelp" -	"go.wit.com/lib/gui/prep" +	"go.wit.com/lib/protobuf/argvpb"  	"go.wit.com/log"  ) @@ -62,10 +61,6 @@ This app talks to your hypervisors via the virtigod daemon.  `  } -func (args) Version() string { -	return ARGNAME + " " + VERSION + "    Built on " + BUILDTIME -} -  var INFO *log.LogFlag  var POLL *log.LogFlag  var WARN *log.LogFlag @@ -85,6 +80,10 @@ func init() {  	handles shell autocomplete  */ +func (args) Version() string { +	return argvpb.StandardVersion(ARGNAME, VERSION, BUILDTIME) +} +  func (args) Appname() string {  	return ARGNAME  } @@ -94,13 +93,15 @@ func (args) Buildtime() (string, string) {  }  func (args) ArgvGui() error { -	me.myGui = fhelp.Gui() // adds the GUI package argv support +	me.myGui = argvpb.Gui() // adds the GUI package argv support  	return nil  } -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{"--version", "list", "droplet"}) +		base := []string{"--version", "list", "droplet"} +		pb.SendStrings(base)  	} else {  		pb.SubCommand(pb.Goargs...)  	} @@ -9,7 +9,7 @@ import (  	"path/filepath"  	"github.com/google/uuid" -	"go.wit.com/lib/gui/prep" +	"go.wit.com/lib/protobuf/argvpb"  	"go.wit.com/lib/protobuf/virtpb"  	"go.wit.com/log"  ) @@ -25,7 +25,7 @@ var resources embed.FS  func main() {  	me = new(virtigoT) -	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  	if os.Getenv("VIRTIGO_HOME") == "" {  		homeDir, _ := os.UserHomeDir() @@ -5,9 +5,8 @@ import (  	"time"  	"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/virtpb"  ) @@ -25,8 +24,8 @@ func (b *virtigoT) Enable() {  // this app's variables  type virtigoT struct { -	auto                  *prep.Auto                     // more experiments for bash handling -	myGui                 *fhelp.GuiPrep                 // the gui toolkit handle +	argv                  *argvpb.Argv                   // shell autocomplete +	myGui                 *argvpb.GuiPrep                // the gui toolkit handle  	e                     *virtpb.Events                 // virt protobuf events  	hmap                  map[*virtpb.Hypervisor]*HyperT // map to the local struct  	names                 []string                       // ?  | 
