summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-17 16:30:14 -0500
committerJeff Carr <[email protected]>2025-10-17 16:30:14 -0500
commit618bcf3a36f2229fb819be8164783e945c157a5a (patch)
tree9f9e3490498ce722a89bf2e931c65400c0bb76db
parent3580a2bba32f43e0a54d882eae0f51239e6e540c (diff)
renamed to argvpb
-rw-r--r--argv.go16
-rw-r--r--main.go6
-rw-r--r--structs.go6
3 files changed, 15 insertions, 13 deletions
diff --git a/argv.go b/argv.go
index b9ab5b7..6d48ed9 100644
--- a/argv.go
+++ b/argv.go
@@ -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...)
}
diff --git a/main.go b/main.go
index 9b7bacd..0fdd559 100644
--- a/main.go
+++ b/main.go
@@ -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()
diff --git a/structs.go b/structs.go
index 42b51c8..2dadbd6 100644
--- a/structs.go
+++ b/structs.go
@@ -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
}