Sfoglia il codice sorgente

invert parse config switch

Tobias Simetsreiter 4 anni fa
parent
commit
ee51c787ea
1 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. 6 6
      sharxz

+ 6 - 6
sharxz

@@ -7,11 +7,14 @@ sharxz(){
     OUTPUT="-"
     DEBUG=false
     PARSE=false
-    while getopts ":dT:o:C:x:n" opt; do
+    while getopts ":dpT:o:C:x:" opt; do
         case $opt in
             d )
                 DEBUG=true
               ;;
+            p )
+                PARSE=true
+              ;;
             T )
                 TAR_OPTIONS+=( $OPTARG )
               ;;
@@ -24,10 +27,7 @@ sharxz(){
             x )
                 CMD="$OPTARG"
               ;;
-            p )
-                PARSE=true
-              ;;
-            \? ) echo "Usage: sharxz [-T TAR_OPTIONS] [-C chdir]" 1>&2
+            \? ) echo "Usage: sharxz [-dp] [-T TAR_OPTIONS] [-C chdir] [-x CMD] path" 1>&2
               ;;
             : )
             echo "Invalid option: $OPTARG requires an argument" 1>&2
@@ -56,7 +56,7 @@ sharxz(){
 
         $DEBUG && du -sh . 1>&2
 
-        $PARSE || parse_options
+        $PARSE && parse_options
 
         print_shar "$INFILE"
     } > "$OUTPUT"