summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-21 09:21:42 -0500
committerJeff Carr <[email protected]>2025-10-21 09:21:42 -0500
commit64b29a3807917b6203b85d8f7f99ff622b947784 (patch)
treee91ed93b48b55697f4aadc51ab9cc87508195216 /init.go
parent303064638637e8ab89313ace25b73fc02cb46408 (diff)
callbacks to argv Exit()
Diffstat (limited to 'init.go')
-rw-r--r--init.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/init.go b/init.go
index 3df1e17..a20b5d2 100644
--- a/init.go
+++ b/init.go
@@ -3,16 +3,21 @@ package ENV
// this is an experiment at this point to
// see how this turns out
-func Init(appname, version, buildtime string, fromargv []string) error {
+func Init(appname, version, buildtime string, fromargv []string, goodFunc func(string), badFunc func(string, error)) error {
APPNAME = appname
VERSION = version
BUILDTIME = buildtime
argv = fromargv
+ goodExit = goodFunc
+ badExit = badFunc
err := loadENV()
if err == nil {
envPB.Init = true
}
+ SetGlobal("lib/ENV", "APPNAME", APPNAME)
+ SetGlobal("lib/ENV", "VERSION", VERSION)
+ SetGlobal("lib/ENV", "BUILDTIME", BUILDTIME)
return err
}