Package:     backup2l
Subject:     display help again
Author:      Joachim Wiedorn <joodebian at joonet.de>
Forwarded:   no
Last-Update: 2017-07-28

Help check comes to late. Now the first check looks for help command.
---

diff -urN s08/backup2l s09/backup2l
--- s08/backup2l	2025-04-25 13:18:00.312392491 +0200
+++ s09/backup2l	2025-04-25 13:25:37.954289533 +0200
@@ -246,15 +246,12 @@
             ;;
         -create)        # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
             afio -Zo $3 < $4 2>&1
-#            afio -Zo - < $4 > $3 2>&1
             ;;
         -toc)           # Arguments: $2 = BID, $3 = archive file name
             afio -Zt $3 | sed 's#^#/#' # 's#^#/#;s#\.z$##'
-#            afio -Zt - < $3 | sed 's#^#/#' # 's#^#/#;s#\.z$##'
             ;;
         -extract)       # Arguments: $2 = BID, $3 = archive file name, $4 = file list file
             afio -Zinw $4 $3 2>&1
-#            afio -Zinw $4 - < $3 2>&1
             ;;
     esac
 }
@@ -1294,11 +1291,20 @@
 
 # Read & validate setup...
 CONF_FILE="/etc/backup2l.conf"
-if [ "$1" = "-c" -o "$1" = "--conf" ]; then
-    shift
-    CONF_FILE=$1
-    shift
-fi
+
+# Go ahead...
+case $1 in
+    -h | --help)
+        usage
+        exit 0
+        ;;
+    -c | --conf)
+        shift
+        CONF_FILE=$1
+        shift
+        ;;
+esac
+
 if [ -f "$CONF_FILE" ]; then
     . $CONF_FILE
 else
@@ -1352,9 +1358,6 @@
 
 # Go ahead...
 case $1 in
-    -h | --help)
-        usage
-        ;;
     -e | --estimate)
         banner
         show_backup_estimates "$2"
