Browse Source

Add saturnin__bug() to help developers help users report bugs

Alois Mahdal 7 years ago
parent
commit
89f01badef
1 changed files with 19 additions and 0 deletions
  1. 19
    0
      src/saturnin.sh

+ 19
- 0
src/saturnin.sh View File

67
 SATURNIN_LIBEXEC_PREFIX="${SATURNIN_LIBEXEC_PREFIX:-}"
67
 SATURNIN_LIBEXEC_PREFIX="${SATURNIN_LIBEXEC_PREFIX:-}"
68
 
68
 
69
 
69
 
70
+saturnin__bug() {
71
+    #
72
+    # Warn about bug in your software
73
+    #
74
+    # Issue warning using warn() from pretty but also add application
75
+    # version.  This is useful when an assertion in your application
76
+    # fails such that it is certain that there is a bug inside it.
77
+    #
78
+    # In such cases, it makes sense to print also version information
79
+    # to help users with reporting.
80
+    #
81
+    local msg
82
+    for msg in "$@";
83
+    do
84
+        warn "bug: $msg"
85
+    done
86
+    warn "bug in $(basename "$0") version: $SATURNIN_APP_VERSION"
87
+}
88
+
70
 saturnin__conf() {
89
 saturnin__conf() {
71
     #
90
     #
72
     # inigrep smart loader
91
     # inigrep smart loader