summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-16 12:13:45 -0500
committerJeff Carr <[email protected]>2025-10-16 12:13:45 -0500
commit28839452b290b83d409193044c5737a92cc1ec3e (patch)
tree9cc108b3f80463b67209cb12f4e044d6990d70d9
parent58083f07bc5b3dc3c93843110746c32492022a12 (diff)
hmm
-rw-r--r--Makefile6
-rw-r--r--dryrun.go2
-rw-r--r--structs.go18
-rw-r--r--theMagicOfAutocomplete.go3
4 files changed, 15 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 2f87593..a91c8be 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
-all: auto.pb.go goimports vet
+all: proto vet
@echo This GO code passes the compile checks
-auto.pb.go: auto.proto
- make generate
+proto:
+ autogenpb --proto auto.proto
generate: clean
go mod init
diff --git a/dryrun.go b/dryrun.go
index e8e36bd..037f0a9 100644
--- a/dryrun.go
+++ b/dryrun.go
@@ -1,6 +1,6 @@
package prep
-// initializes logging and command line options
+// think about using something like this
func DryRun() bool {
return false
diff --git a/structs.go b/structs.go
index 31b7cc4..2594094 100644
--- a/structs.go
+++ b/structs.go
@@ -18,21 +18,26 @@ type ArgsBash struct {
Bash bool `arg:"--bash" help:"generate bash completion"`
}
+// returns the name of the executable registered for shell autocomplete
+func AppName() string {
+ return me.ARGNAME
+}
+
// try this struct out (?)
var me *AutoArgs
// this is a work in progress
type AutoArgs struct {
- id int // should be unique
- hidden bool // don't update the toolkits when it's hidden
- Auto func([]string) // the function for shell autocomplete
+ id int // should be unique
+ // hidden bool // don't update the toolkits when it's hidden
+ Auto func([]string) // the function for shell autocomplete
examples func() string // some examples
appExit func() // app Exit()
buildtime func() (string, string) // some examples
- pp *arg.Parser // for parsing the command line args. Yay to alexf lint!
autoFunc func(*Auto) // also a function for autocomplete
guiFunc func() error // enables Gui functions
err error // store any errors from argv
+ pp *arg.Parser // for parsing the command line args. Yay to alexf lint!
pb *Auto
ARGNAME string // a good way to track the name of the binary ?
@@ -53,8 +58,3 @@ func GetLast(cur string, argv []string) string {
}
return ""
}
-
-// returns the name of the executable registered for shell autocomplete
-func AppName() string {
- return me.ARGNAME
-}
diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go
index 7fddb00..ae0888d 100644
--- a/theMagicOfAutocomplete.go
+++ b/theMagicOfAutocomplete.go
@@ -15,11 +15,11 @@ import (
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
)
-// TODO: rename 'all' to 'pb' and 'pb' to 'pbnew' or 'pbcur'
func Autocomplete(dest any) *Auto {
me = new(AutoArgs) // todo: redo this
findAppInfo(dest) // parses back to main() for argv info
+ // todo: figure this out
if me.guiFunc != nil {
// register gui args
me.guiFunc()
@@ -42,6 +42,7 @@ func Autocomplete(dest any) *Auto {
if err != nil {
// there is no history.
// todo: initialize the history file
+ // todo: check if this is automatically done already
}
// set the start time of the binary