Browse Source

lz: reindent with 4 spaces

master
Matteo Cypriani 1 year ago
parent
commit
8f71967758
1 changed files with 51 additions and 49 deletions
  1. 51
    49
      archivers/lz.sh

+ 51
- 49
archivers/lz.sh View File

@@ -22,67 +22,69 @@
22 22
 PROGRAM="`basename $0`"
23 23
 
24 24
 if [ "$PROGRAM" = "lz" ] ; then
25
-	ACTION="t"
25
+    ACTION="t"
26 26
 elif [ "$PROGRAM" = "uz" ] ; then
27
-	ACTION="x"
27
+    ACTION="x"
28 28
 else
29
-	echo '$0 = "'"$0"' (not "lz" nor "uz")!' >&2
30
-	exit 1
29
+    echo '$0 = "'"$0"' (not "lz" nor "uz")!' >&2
30
+    exit 1
31 31
 fi
32 32
 
33 33
 
34 34
 ## Verify number of arguments ##
35 35
 
36 36
 if [ $# -lt 1 ] ; then
37
-	echo "$PROGRAM requires at least one argument!" >&2
38
-	exit 2
37
+    echo "$PROGRAM requires at least one argument!" >&2
38
+    exit 2
39 39
 fi
40 40
 
41 41
 
42 42
 ## Process files ##
43 43
 
44 44
 for F in "$@" ; do
45
-	if [ "$ACTION" = "t" ] ; then
46
-		echo "*** Listing « $F » ***" >&2
47
-	else
48
-		echo "Extracting « $F »…"
49
-	fi
50
-
51
-	# Simple Tar archive
52
-	if [ "`basename "$F" .tar`" != "$F" ] ; then
53
-		FORMAT=""
54
-
55
-	# GZipped Tar
56
-	elif [ "`basename "$F" .tar.gz`" != "$F" \
57
-				-o "`basename "$F" .tgz`" != "$F" ] ; then
58
-		FORMAT="--gzip"
59
-
60
-	# BZipped Tar
61
-	elif [ "`basename "$F" .tar.bz2`" != "$F" \
62
-				-o "`basename "$F" .tbz`" != "$F" \
63
-				-o "`basename "$F" .tb2`" != "$F" ] ; then
64
-		FORMAT="--bzip"
65
-
66
-	# XZipped Tar
67
-	elif [ "`basename "$F" .tar.xz`" != "$F" \
68
-				-o "`basename "$F" .txz`" != "$F" ] ; then
69
-		FORMAT="--xz"
70
-
71
-	# Compressed Tar
72
-	elif [ "`basename "$F" .tar.Z`" != "$F" \
73
-				-o "`basename "$F" .taz`" != "$F" ] ; then
74
-		FORMAT="--compress"
75
-
76
-	# LZMA compressed Tar
77
-	elif [ "`basename "$F" .tar.lzma`" != "$F" \
78
-				-o "`basename "$F" .tlz`" != "$F" ] ; then
79
-		FORMAT="--lzma"
80
-
81
-	# Unknown extension
82
-	else
83
-		echo "Extension of file « $F » unknown! (skipping)" >&2
84
-		continue
85
-	fi
86
-
87
-	tar "$FORMAT" -"$ACTION"f "$F"
45
+    if [ "$ACTION" = "t" ] ; then
46
+        echo "*** Listing « $F » ***" >&2
47
+    else
48
+        echo "Extracting « $F »…"
49
+    fi
50
+
51
+    # Simple Tar archive
52
+    if [ "`basename "$F" .tar`" != "$F" ] ; then
53
+        FORMAT=""
54
+
55
+        # GZipped Tar
56
+    elif [ "`basename "$F" .tar.gz`" != "$F" \
57
+        -o "`basename "$F" .tgz`" != "$F" ] ; then
58
+    FORMAT="--gzip"
59
+
60
+    # BZipped Tar
61
+    elif [ "`basename "$F" .tar.bz2`" != "$F" \
62
+        -o "`basename "$F" .tbz`" != "$F" \
63
+        -o "`basename "$F" .tb2`" != "$F" ] ; then
64
+    FORMAT="--bzip"
65
+
66
+    # XZipped Tar
67
+    elif [ "`basename "$F" .tar.xz`" != "$F" \
68
+        -o "`basename "$F" .txz`" != "$F" ] ; then
69
+    FORMAT="--xz"
70
+
71
+    # Compressed Tar
72
+    elif [ "`basename "$F" .tar.Z`" != "$F" \
73
+        -o "`basename "$F" .taz`" != "$F" ] ; then
74
+    FORMAT="--compress"
75
+
76
+    # LZMA compressed Tar
77
+    elif [ "`basename "$F" .tar.lzma`" != "$F" \
78
+        -o "`basename "$F" .tlz`" != "$F" ] ; then
79
+    FORMAT="--lzma"
80
+
81
+    # Unknown extension
82
+    else
83
+        echo "Extension of file « $F » unknown! (skipping)" >&2
84
+        continue
85
+    fi
86
+
87
+    tar "$FORMAT" -"$ACTION"f "$F"
88 88
 done
89
+
90
+# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4

Loading…
Cancel
Save