Compare commits
1 Commits
28e4c112af
...
4.x
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5720cf1cac |
@@ -182,6 +182,7 @@ utaz()
|
||||
printf "\t- tar.bz2, .tbz2\n"
|
||||
printf "\t- tar.xz, .txz\n"
|
||||
printf "\t- tar.lz, .tlz\n"
|
||||
printf "\t- lzo\n"
|
||||
printf "\t- rar\n"
|
||||
printf "\t- arj\n"
|
||||
printf "\t- lha, lzh\n"
|
||||
@@ -266,6 +267,9 @@ utaz()
|
||||
extractor="_unxz"
|
||||
;;
|
||||
*.tar.lz|*.tlz)
|
||||
extractor="_unlzip"
|
||||
;;
|
||||
*.lzo)
|
||||
extractor="_unlzop"
|
||||
;;
|
||||
*.tar)
|
||||
@@ -444,7 +448,7 @@ taz()
|
||||
# shellcheck disable=SC2329
|
||||
_dolz()
|
||||
{
|
||||
local procopt="--threads $2"
|
||||
local procopt=(--threads "$2")
|
||||
local command=plzip
|
||||
|
||||
command -v plzip >/dev/null 2>&1 || {
|
||||
@@ -453,7 +457,7 @@ taz()
|
||||
return 127
|
||||
}
|
||||
command=lzip
|
||||
local procopt=""
|
||||
local procopt=()
|
||||
[[ $2 -gt 1 ]] &&
|
||||
disp W "lzip doesn't support multithreading, falling back to 1 thread." &&
|
||||
disp W "Consider installing plzip to obtain multithreading abilities."
|
||||
@@ -461,7 +465,7 @@ taz()
|
||||
|
||||
local opt=()
|
||||
[[ $4 ]] && opt=('-vv')
|
||||
opt+=("$procopt")
|
||||
opt+=("${procopt[@]}")
|
||||
|
||||
# Compress with lzip (lzma)
|
||||
$command "${opt[@]}" --keep "-$3" "$1"
|
||||
@@ -471,7 +475,7 @@ taz()
|
||||
# shellcheck disable=SC2329
|
||||
_dogz()
|
||||
{
|
||||
local procopt="--processes $2"
|
||||
local procopt=(--processes "$2")
|
||||
local command=pigz
|
||||
|
||||
command -v pigz >/dev/null 2>&1 || {
|
||||
@@ -480,7 +484,7 @@ taz()
|
||||
return 127
|
||||
}
|
||||
local command="gzip --compress"
|
||||
local procopt=""
|
||||
local procopt=()
|
||||
[[ $2 -gt 1 ]] &&
|
||||
disp W "gzip doesn't support multithreading, falling back to 1 thread." &&
|
||||
disp W "Consider installing pigz to obtain multithreading abilities."
|
||||
@@ -488,7 +492,7 @@ taz()
|
||||
|
||||
local opt=()
|
||||
[[ $4 ]] && opt=('--verbose')
|
||||
opt+=("$procopt")
|
||||
opt+=("${procopt[@]}")
|
||||
|
||||
# Compress with gzip
|
||||
$command "${opt[@]}" --keep "-$3" "$1"
|
||||
@@ -498,7 +502,7 @@ taz()
|
||||
# shellcheck disable=SC2329
|
||||
_dobz2()
|
||||
{
|
||||
local procopt="-p$2"
|
||||
local procopt=("-p$2")
|
||||
local command=pbzip2
|
||||
|
||||
command -v pbzip2 >/dev/null 2>&1 || {
|
||||
@@ -507,7 +511,7 @@ taz()
|
||||
return 127
|
||||
}
|
||||
local command=bzip2
|
||||
local procopt=""
|
||||
local procopt=()
|
||||
[[ $2 -gt 1 ]] &&
|
||||
disp W "bzip2 doesn't support multithreading, falling back to 1 thread." &&
|
||||
disp W "Consider installing pbzip2 to obtain multithreading abilities."
|
||||
@@ -515,7 +519,7 @@ taz()
|
||||
|
||||
local opt=()
|
||||
[[ $4 ]] && opt=('-v')
|
||||
opt+=("$procopt")
|
||||
opt+=("${procopt[@]}")
|
||||
|
||||
# Compress with bz2
|
||||
$command "${opt[@]}" --compress --keep "-$3" "$1"
|
||||
|
||||
Reference in New Issue
Block a user