ソースを参照

Add saturnin__bug() to help developers help users report bugs

Alois Mahdal 7 年 前
コミット
89f01badef
共有1 個のファイルを変更した19 個の追加0 個の削除を含む
  1. 19
    0
      src/saturnin.sh

+ 19
- 0
src/saturnin.sh ファイルの表示

@@ -67,6 +67,25 @@ SATURNIN_LIBEXEC="${SATURNIN_LIBEXEC:-}"
67 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 89
 saturnin__conf() {
71 90
     #
72 91
     # inigrep smart loader