diff options
| author | Jeff Carr <[email protected]> | 2025-10-17 16:30:14 -0500 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-17 16:30:14 -0500 | 
| commit | 618bcf3a36f2229fb819be8164783e945c157a5a (patch) | |
| tree | 9f9e3490498ce722a89bf2e931c65400c0bb76db | |
| parent | 3580a2bba32f43e0a54d882eae0f51239e6e540c (diff) | |
renamed to argvpb
| -rw-r--r-- | argv.go | 16 | ||||
| -rw-r--r-- | main.go | 6 | ||||
| -rw-r--r-- | structs.go | 6 | 
3 files changed, 15 insertions, 13 deletions
@@ -6,7 +6,7 @@ package main  import (  	"os" -	"go.wit.com/lib/gui/prep" +	"go.wit.com/lib/protobuf/argvpb"  )  /* @@ -30,10 +30,6 @@ type args struct {  type EmptyCmd struct {  } -func (args) Version() string { -	return ARGNAME + " " + VERSION + "    Built on " + BUILDTIME -} -  func (a args) Description() string {  	return `  startxplacment -- run this after 'startx' to restore all your apps @@ -55,9 +51,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{"--restore", "save", "dump", "dumpx", "list", "--version"}) +		base := []string{"--restore", "save", "dump", "dumpx", "list", "--version"} +		pb.SendStrings(base)  	} else {  		pb.SubCommand(pb.Goargs...)  	} @@ -8,7 +8,7 @@ package main  import (  	"fmt" -	"go.wit.com/lib/gui/prep" +	"go.wit.com/lib/protobuf/argvpb"  	"go.wit.com/log"  ) @@ -26,8 +26,8 @@ var configFile string = "/home/jcarr/.config/startxplacement.out"  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.myGui = argvpb.Gui()              // prepares the GUI package for go-args +	me.argv = argvpb.Autocomplete(&argv) // adds shell auto complete to go-args  	if argv.DumpX != nil {  		doDumpX() @@ -4,13 +4,13 @@  package main  import ( -	"go.wit.com/lib/gui/prep" +	"go.wit.com/lib/protobuf/argvpb"  )  var me *mainType  // this app's variables  type mainType struct { -	auto  *prep.Auto    // more experiments for bash handling -	myGui *prep.GuiPrep // the gui toolkit handle +	argv  *argvpb.Argv    // shell autocomplete +	myGui *argvpb.GuiPrep // the gui toolkit handle  }  | 
