Browse Source

Change default exit status of usage_is to 2

Similar to grep or test, 1 is reserved for "no", 2 is used for
"incorrect use/syntax"
Alois Mahdal 10 years ago
parent
commit
bd4ab8ed17
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      include/core.sh

+ 2
- 2
include/core.sh View File

42
 
42
 
43
 usage_is() {
43
 usage_is() {
44
     #
44
     #
45
-    # Echo out usage patterns and (by default) exit 1
45
+    # Echo out usage patterns and (by default) exit 2
46
     #
46
     #
47
     # Specify -e STATUS for exit status, or "-E" to prevent
47
     # Specify -e STATUS for exit status, or "-E" to prevent
48
     # exiting.  Use "--" to delimit end of arguments processed
48
     # exiting.  Use "--" to delimit end of arguments processed
51
     # Recommended usage is to define usage() in your script and
51
     # Recommended usage is to define usage() in your script and
52
     # use this in body.
52
     # use this in body.
53
     #
53
     #
54
-    local es=1
54
+    local es=2
55
     while true; do case "$1" in
55
     while true; do case "$1" in
56
         -e) es="$2"; shift 2 ;;
56
         -e) es="$2"; shift 2 ;;
57
         -E) es="";   shift   ;;
57
         -E) es="";   shift   ;;