diff options
| author | Jeff Carr <[email protected]> | 2025-10-17 15:43:30 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-17 15:43:30 -0500 | 
| commit | 81dde3b0067315b3126438b220e5ab5026a74c20 (patch) | |
| tree | c6d53a70c5ef79f8673fc3992eedb9cc26614eef | |
| parent | 7b2263c9beaa63f041074b5cd21e692188a0a9e6 (diff) | |
argv moved to protobuf location
| -rw-r--r-- | argv.go | 22 | ||||
| -rw-r--r-- | main.go | 5 | ||||
| -rw-r--r-- | structs.go | 6 | 
3 files changed, 14 insertions, 19 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"  ) @@ -32,16 +32,6 @@ type args struct {  type EmptyCmd struct {  } -func (args) Version() string { -	return "zookeeper " + VERSION + "   Built on: " + BUILDTIME -} - -/* -func init() { -	arg.MustParse(&argv) -} -*/ -  func (a args) Description() string {  	return `           this daemon talks to zookeeper @@ -67,6 +57,10 @@ func init() {  	handles shell autocomplete  */ +func (args) Version() string { +	return argvpb.StandardVersion(ARGNAME, VERSION, BUILDTIME) +} +  func (args) Appname() string {  	return ARGNAME  } @@ -75,9 +69,11 @@ func (args) Buildtime() (string, string) {  	return BUILDTIME, VERSION  } -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{"gui", "list", "--daemon", "--version"}) +		base := []string{"gui", "list", "--daemon", "--version"} +		pb.SendStrings(base)  	} else {  		pb.SubCommand(pb.Goargs...)  	} @@ -8,7 +8,7 @@ import (  	"time"  	"go.wit.com/lib/config" -	"go.wit.com/lib/gui/prep" +	"go.wit.com/lib/protobuf/argvpb"  	"go.wit.com/lib/protobuf/httppb"  	"go.wit.com/lib/protobuf/zoopb"  	"go.wit.com/log" @@ -21,8 +21,7 @@ var ARGNAME string = "zookeeper"  func main() {  	me = new(mainType) -	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  	if argv.Daemon {  		// turn off timestamps for STDOUT (systemd adds them) @@ -8,7 +8,7 @@ import (  	"go.wit.com/gui"  	"go.wit.com/lib/gadgets" -	"go.wit.com/lib/gui/prep" +	"go.wit.com/lib/protobuf/argvpb"  	"go.wit.com/lib/protobuf/zoopb"  ) @@ -16,7 +16,7 @@ var me *mainType  // this app's variables  type mainType struct { -	auto         *prep.Auto             // more experiments for bash handling +	argv         *argvpb.Argv           // shell autocomplete  	hostname     string                 // my fqdn dns zookeeper hostname  	pollDelay    time.Duration          // how often to report our status  	dog          *time.Ticker           // the watchdog timer @@ -26,7 +26,7 @@ type mainType struct {  	machines     *zoopb.Machines        // every machine that has reported itself to the zookeeper  	targets      map[string]string      // what versions the machines should be running  	upgrade      map[string]bool        // use this to trigger builds -	myGui        *prep.GuiPrep          // the gui toolkit handle +	myGui        *argvpb.GuiPrep        // the gui toolkit handle  	machinesWin  *gadgets.GenericWindow // the machines gui window  	machinesBox  *gui.Node              // the machines gui parent box widget  	machinesTB   *zoopb.MachinesTable   // the machines gui table buffer  | 
