summaryrefslogtreecommitdiff
path: root/exit.go
diff options
context:
space:
mode:
Diffstat (limited to 'exit.go')
-rw-r--r--exit.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/exit.go b/exit.go
new file mode 100644
index 0000000..3581330
--- /dev/null
+++ b/exit.go
@@ -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)
+}