diff options
| author | Jeff Carr <[email protected]> | 2025-10-17 17:18:38 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-17 17:18:38 -0500 | 
| commit | 7cfeaaa25c46d87919b5a61dd2338765f40fc23c (patch) | |
| tree | 3b3d6cf7540bc3192ef686c737a01afb5a3321d3 | |
| parent | 248f081df39436c234f38c3a1980365e2b4673c7 (diff) | |
lib now named 'argvpb'
| -rw-r--r-- | argv.go | 18 | ||||
| -rw-r--r-- | main.go | 9 | ||||
| -rw-r--r-- | structs.go | 6 | 
3 files changed, 17 insertions, 16 deletions
@@ -11,7 +11,7 @@ package main  import (  	"os" -	"go.wit.com/lib/gui/prep" +	"go.wit.com/lib/protobuf/argvpb"  	"go.wit.com/log"  ) @@ -30,10 +30,6 @@ type args struct {  type EmptyCmd struct {  } -func (args) Version() string { -	return "gus " + VERSION + "   Built on: " + BUILDTIME -} -  func (a args) Description() string {  	return `  	"Phantastic Gus" your network squirrel @@ -60,15 +56,21 @@ func init() {  	handles shell autocomplete  */ +func (args) Version() string { +	return argvpb.StandardVersion(ARGNAME, VERSION, BUILDTIME) +} +  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{"--bash", "--me", "gui", "--daemon"}) +		base := []string{"--bash", "--me", "gui", "--daemon"} +		pb.SendStrings(base)  	} else { -		pb.SubCommand(pb.Argv...) +		pb.SubCommand(pb.Goargs...)  	}  	os.Exit(0)  } @@ -14,10 +14,9 @@ import (  	sync "sync"  	"time" -	"github.com/svent/go-nbreader" -  	"github.com/google/uuid" -	"go.wit.com/lib/gui/prep" +	"github.com/svent/go-nbreader" +	"go.wit.com/lib/protobuf/argvpb"  	"go.wit.com/log"  	timestamppb "google.golang.org/protobuf/types/known/timestamppb"  ) @@ -32,8 +31,8 @@ var resources embed.FS  func main() {  	me = new(gusconf) -	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.myGui = argvpb.Gui()              // prepares the GUI package for go-args +	me.argv = argvpb.Autocomplete(&argv) // adds shell auto complete to go-args  	log.Info("tmp hack", uuid.New().String()) @@ -9,15 +9,15 @@ import (  	"go.wit.com/gui"  	"go.wit.com/lib/gadgets" -	"go.wit.com/lib/gui/prep" +	"go.wit.com/lib/protobuf/argvpb"  )  var me *gusconf  // this app's variables  type gusconf struct { -	auto          *prep.Auto        // more experiments for bash handling -	myGui         *prep.GuiPrep     // the base of the gui +	argv          *argvpb.Argv      // shell autocomplete +	myGui         *argvpb.GuiPrep   // the base of the gui  	portmaps      *Portmaps         // the portmap window  	portwin       *stdTableWin      // the portwin window  	events        *Events           // the event log  | 
