summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-17 17:18:38 -0500
committerJeff Carr <[email protected]>2025-10-17 17:18:38 -0500
commit7cfeaaa25c46d87919b5a61dd2338765f40fc23c (patch)
tree3b3d6cf7540bc3192ef686c737a01afb5a3321d3
parent248f081df39436c234f38c3a1980365e2b4673c7 (diff)
lib now named 'argvpb'
-rw-r--r--argv.go18
-rw-r--r--main.go9
-rw-r--r--structs.go6
3 files changed, 17 insertions, 16 deletions
diff --git a/argv.go b/argv.go
index dd84d38..b9e1356 100644
--- a/argv.go
+++ b/argv.go
@@ -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)
}
diff --git a/main.go b/main.go
index 80030d1..d158e8b 100644
--- a/main.go
+++ b/main.go
@@ -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())
diff --git a/structs.go b/structs.go
index e555300..8aab53a 100644
--- a/structs.go
+++ b/structs.go
@@ -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