From 0b506fea0c9aeb450db6fdaba572041fd900c05b Mon Sep 17 00:00:00 2001 From: Xeonacid Date: Wed, 9 Jun 2021 19:29:04 +0800 Subject: [PATCH] feat(extract): add cpio support --- plugins/extract/README.md | 1 + plugins/extract/_extract | 2 +- plugins/extract/extract.plugin.zsh | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/extract/README.md b/plugins/extract/README.md index 1dd8e19c0..44f0b05a1 100644 --- a/plugins/extract/README.md +++ b/plugins/extract/README.md @@ -22,6 +22,7 @@ plugins=(... extract) | `aar` | Android library file | | `bz2` | Bzip2 file | | `cab` | Microsoft cabinet archive | +| `cpio` | Cpio archive | | `deb` | Debian package | | `ear` | Enterprise Application aRchive | | `gz` | Gzip file | diff --git a/plugins/extract/_extract b/plugins/extract/_extract index 31a7facbe..27b099c9e 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -3,5 +3,5 @@ _arguments \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \ - "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|cab|deb|ear|gz|ipa|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \ + "*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|cab|cpio|deb|ear|gz|ipa|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \ && return 0 diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index e63b9494f..ac181fa78 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -70,6 +70,7 @@ extract() { ;; (*.zst) unzstd "$1" ;; (*.cab) cabextract -d "$extract_dir" "$1" ;; + (*.cpio) cpio -idmvF "$1" ;; (*) echo "extract: '$1' cannot be extracted" >&2 success=1