diff options
| author | Jeff Carr <[email protected]> | 2025-10-04 15:30:09 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-04 15:30:09 -0500 |
| commit | ec669a62c02da925dc5659d4525ff4eba05fae11 (patch) | |
| tree | ebaf5a2009dde9e763f8e514f0cdbb53d590a770 /exit.go | |
| parent | 85885a09373e59c8a8ea0bfc015bee647182fd32 (diff) | |
smart exit function
Diffstat (limited to 'exit.go')
| -rw-r--r-- | exit.go | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +package prep + +import ( + "os" + "time" + + "go.wit.com/lib/gui/shell" + "go.wit.com/log" +) + +// initializes logging and command line options + +func (pb *Auto) BadExit(msg string, err error) { + if err != nil { + log.Info(err) + } + dur := time.Since(pb.Ctime.AsTime()) + log.Infof("%s: %s (%s)\n", pb.Argname, msg, shell.FormatDuration(dur)) + os.Exit(-1) +} |
