summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-21 09:22:12 -0500
committerJeff Carr <[email protected]>2025-10-21 09:22:12 -0500
commite9c3000abafd70702cb9db6e3738115012f498eb (patch)
tree2d9223d8a5bb6d5d7ddc0724dcdbf720e0bf0144
parentce8d34e70c9de0e00343890b065ae38fafba0eab (diff)
update init to lib/ENV
-rw-r--r--argv.Exit.go8
-rw-r--r--theMagicOfAutocomplete.go2
2 files changed, 9 insertions, 1 deletions
diff --git a/argv.Exit.go b/argv.Exit.go
index bbf5c70..c2f33cb 100644
--- a/argv.Exit.go
+++ b/argv.Exit.go
@@ -15,6 +15,14 @@ import (
// also, it supports a custom Exit() back to your application
+func GoodExit(msg string) {
+ me.pb.GoodExit(msg)
+}
+
+func BadExit(msg string, err error) {
+ me.pb.BadExit(msg, err)
+}
+
func (pb *Argv) GoodExit(msg string) {
go ExitWatchdog()
if me.appExit != nil {
diff --git a/theMagicOfAutocomplete.go b/theMagicOfAutocomplete.go
index 592e765..e8e4594 100644
--- a/theMagicOfAutocomplete.go
+++ b/theMagicOfAutocomplete.go
@@ -72,7 +72,7 @@ func Autocomplete(dest any) *Argv {
all := NewArgvs()
// initializes the application config file
- ENV.Init(me.pb.AppInfo.APPNAME, me.pb.AppInfo.VERSION, cobol.Time(me.pb.AppInfo.BUILDTIME), me.pb.Real)
+ ENV.Init(me.pb.AppInfo.APPNAME, me.pb.AppInfo.VERSION, cobol.Time(me.pb.AppInfo.BUILDTIME), me.pb.Real, GoodExit, BadExit)
// loads the autocomplete history file
err := config.LoadCache(all, "argv", me.pb.AppInfo.APPNAME) //