mirror of
https://github.com/eth-p/bat-extras.git
synced 2025-01-05 20:58:51 +01:00
batpipe: Add support for *.xz files
This commit is contained in:
parent
0d2e999b2a
commit
dafd2addc0
@ -27,6 +27,7 @@ Like [lesspipe](https://github.com/wofr06/lesspipe), `batpipe` is designed to wo
|
||||
| `*.tar`, `*.tar.gz` | `tar` |
|
||||
| `*.zip`, `*.jar` | `unzip` |
|
||||
| `*.gz` | `gunzip` |
|
||||
| `*.xz` | `xz` |
|
||||
|
||||
|
||||
## External Viewers
|
||||
|
@ -109,7 +109,7 @@ fi
|
||||
# Viewers:
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
BATPIPE_VIEWERS=("ls" "tar" "unzip" "gunzip")
|
||||
BATPIPE_VIEWERS=("ls" "tar" "unzip" "gunzip" "xz")
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
@ -189,6 +189,24 @@ viewer_gunzip_process() {
|
||||
return $?
|
||||
}
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
viewer_xz_supports() {
|
||||
command -v "xz" &> /dev/null || return 1
|
||||
[[ -z "$3" ]] || return 1
|
||||
|
||||
case "$2" in
|
||||
*.xz) return 0 ;;
|
||||
esac
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
viewer_xz_process() {
|
||||
xz --decompress -k -c "$1"
|
||||
return $?
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Functions:
|
||||
# -----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user