summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
Diffstat (limited to 'init.go')
-rw-r--r--init.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/init.go b/init.go
index 1c056d1..7c9e9f8 100644
--- a/init.go
+++ b/init.go
@@ -15,6 +15,11 @@ func Init(dest any, APPNAME string, anyString string, VERSION string) {
PB = me.pb
me.debug = true
+ // set the start time of the binary
+ now := time.Now()
+ PB.Ctime = timestamppb.New(now)
+ me.pb.Uuid = uuid.New().String() // todo: add options to track this
+
// needed by bash for autocomplete, help & debugging
Stdout = NewStringWriter(&PB.Stdout) // bash uses this to match strings
Stderr = NewStringWriter(&PB.Stderr) // bash dumps this as "help" about application options
@@ -43,13 +48,6 @@ func Init(dest any, APPNAME string, anyString string, VERSION string) {
}
me.pb.AppInfo = app
- // shouldn't be needed but is because this code doesn't work right yet
- me.pb.Uuid = uuid.New().String()
-
- // set the start time of the binary
- now := time.Now()
- me.pb.Ctime = timestamppb.New(now)
-
// makes sure the application has the
// needed functions defined, otherwise dies
verifyApplication(dest)