summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-17 11:44:39 -0500
committerJeff Carr <[email protected]>2025-10-17 11:44:39 -0500
commit923ab262f624bd50c543062c4f3f2db9e577d5fb (patch)
tree0a028b65e2800a291e44ec7c1c945aa30f111897
parent0be9867c3193033977951e853445464fb9e4596a (diff)
Finally renamed prep to argvpb
I think this will be the final resting palce for this part of the shell autocomplete. At least I hope so.
-rw-r--r--argv.go16
-rw-r--r--generateHeader.go6
-rw-r--r--main.go4
-rw-r--r--structs.go6
4 files changed, 17 insertions, 15 deletions
diff --git a/argv.go b/argv.go
index c90d486..9d04352 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"
)
/*
@@ -54,10 +54,6 @@ Example usage:
`
}
-func (args) Version() string {
- return "go.wit.com/apps/autogenpb " + VERSION + " Built on " + BUILDTIME
-}
-
/*
handles shell autocomplete
*/
@@ -74,9 +70,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{"--bash", "--proto", "--regret", "--debug", "--renumber", "--reformat", "--delete", "--dry-run"})
+ base := []string{"--bash", "--proto", "--regret", "--debug", "--renumber", "--reformat", "--delete", "--dry-run"}
+ pb.SendStrings(base)
} else {
pb.SubCommand(pb.Goargs...)
}
diff --git a/generateHeader.go b/generateHeader.go
index d961646..72fdc9e 100644
--- a/generateHeader.go
+++ b/generateHeader.go
@@ -8,7 +8,7 @@ import (
"io"
"os"
- "go.wit.com/lib/gui/prep"
+ "go.wit.com/lib/protobuf/argvpb"
"go.wit.com/log"
)
@@ -20,7 +20,7 @@ func pbHeaderComment(w io.Writer) {
fmt.Fprintln(w, "// user defined Mutex locks were auto added")
fmt.Fprintln(w, "//")
fmt.Fprintln(w, "// This file was autogenerated with autogenpb:")
- fmt.Fprintln(w, "// ", prep.StandardVersion(ARGNAME, VERSION, BUILDTIME))
+ fmt.Fprintln(w, "// ", argvpb.StandardVersion(ARGNAME, VERSION, BUILDTIME))
fmt.Fprintln(w, "// Theese sort.pb.go and marshal.pb.go files are autogenerated")
fmt.Fprintln(w, "// The autogenpb sources have example .proto files with instructions")
fmt.Fprintln(w, "")
@@ -32,7 +32,7 @@ func headerComment(w io.Writer) {
fmt.Fprintln(w, "// go install go.wit.com/apps/autogenpb@latest")
fmt.Fprintln(w, "//")
fmt.Fprintln(w, "// This file was autogenerated with autogenpb:")
- fmt.Fprintln(w, "// ", prep.StandardVersion(ARGNAME, VERSION, BUILDTIME))
+ fmt.Fprintln(w, "// ", argvpb.StandardVersion(ARGNAME, VERSION, BUILDTIME))
fmt.Fprintln(w, "// Theese sort.pb.go and marshal.pb.go files are autogenerated")
fmt.Fprintln(w, "// The autogenpb sources have example .proto files with instructions")
fmt.Fprintln(w, "//")
diff --git a/main.go b/main.go
index e386101..c94b7f3 100644
--- a/main.go
+++ b/main.go
@@ -19,8 +19,8 @@ import (
"strings"
"go.wit.com/lib/fhelp"
- "go.wit.com/lib/gui/prep"
"go.wit.com/lib/gui/shell"
+ "go.wit.com/lib/protobuf/argvpb"
"go.wit.com/log"
)
@@ -32,7 +32,7 @@ var ARGNAME string = "autogenpb"
func main() {
me = new(mainType)
- me.sh = prep.Autocomplete(&argv) // adds shell auto complete to go-args
+ me.sh = argvpb.Autocomplete(&argv) // adds shell auto complete to go-args
me.pb = new(Files)
var s string
var err error
diff --git a/structs.go b/structs.go
index 86985d2..2217a10 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 {
- sh *prep.Auto // shell autocomplete
- pb *Files // all the proto files as they get parsed (into another protobuf file)
+ sh *argvpb.Argv // shell autocomplete
+ pb *Files // all the proto files as they get parsed (into another protobuf file)
}