소스 검색

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