summaryrefslogtreecommitdiff
path: root/theMagicOfAutocomplete.go
diff options
context:
space:
mode:
Diffstat (limited to 'theMagicOfAutocomplete.go')
-rw-r--r--theMagicOfAutocomplete.go27
1 files changed, 23 insertions, 4 deletions
diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go
index a4137d6..ee20b24 100644
--- a/theMagicOfAutocomplete.go
+++ b/theMagicOfAutocomplete.go
@@ -16,9 +16,31 @@ import (
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
)
+// gets APPNAME, BUILDTIME and VERSION from the application
+func initAppname() {
+ ARGNAME, anyString, VERSION := me.initArgvFunc()
+ me.ARGNAME = ARGNAME
+ me.VERSION = VERSION
+ var err error
+ me.BUILDTIME, err = cobol.GetTime(anyString)
+ if err != nil {
+ log.Printf("TIME ERR=(%v) time=(%v) BUILTIME=(%v)\n", err, anyString, me.BUILDTIME)
+ }
+}
+
func Autocomplete(dest any) *Argv {
me = new(AutoArgs) // todo: redo this
- findAppInfo(dest) // parses back to main() for argv info
+ me.pb = new(Argv)
+
+ // makes sure the application has the
+ // needed functions defined, otherwise panics
+ verifyApplication(dest)
+
+ // gets APPNAME, BUILDTIME and VERSION from the application
+ initAppname()
+
+ // parses os.Args into a protobuf
+ me.pb.parseArgv()
// todo: figure this out
if me.guiFunc != nil {
@@ -29,9 +51,6 @@ func Autocomplete(dest any) *Argv {
// log.Info("no gui init")
}
- // parses os.Args into a protobuf
- me.pb = parseArgv(me.ARGNAME)
-
// the argv history
all := NewArgvs()