0b506fea0c9aeb450db6fdaba572041fd900c05b
- Author
- Xeonacid <h.dwwwwww@gmail.com>
- Committer
- Marc Cornellà <hello@mcornella.com>
- Date
Message
feat(extract): add cpio support
Diff
1diff --git a/plugins/extract/README.md b/plugins/extract/README.md
2index 1dd8e19c0d7a78ac77416cf5c5d4d2b93f6f24a2..44f0b05a1c35095da23b5d11e191b8c6c79f87b7 100644
3--- a/plugins/extract/README.md
4+++ b/plugins/extract/README.md
5@@ -22,6 +22,7 @@ plugins=(... extract)
6 | `aar` | Android library file |
7 | `bz2` | Bzip2 file |
8 | `cab` | Microsoft cabinet archive |
9+| `cpio` | Cpio archive |
10 | `deb` | Debian package |
11 | `ear` | Enterprise Application aRchive |
12 | `gz` | Gzip file |
13diff --git a/plugins/extract/_extract b/plugins/extract/_extract
14index 31a7facbec2d31a4d2d80c7bf5cc71dcb6eb9b3b..27b099c9e4efe741010947a887568d9733b0e8d6 100644
15--- a/plugins/extract/_extract
16+++ b/plugins/extract/_extract
17@@ -3,5 +3,5 @@
18
19 _arguments \
20 '(-r --remove)'{-r,--remove}'[Remove archive.]' \
21- "*::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)(-.)'" \
22+ "*::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)(-.)'" \
23 && return 0
24diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh
25index e63b9494fdfd8c7ec81c5b327b7dab6cfb75d0ad..ac181fa78b2cd0ce5c0403a72b7887f2885b48df 100644
26--- a/plugins/extract/extract.plugin.zsh
27+++ b/plugins/extract/extract.plugin.zsh
28@@ -70,6 +70,7 @@ extract() {
29 ;;
30 (*.zst) unzstd "$1" ;;
31 (*.cab) cabextract -d "$extract_dir" "$1" ;;
32+ (*.cpio) cpio -idmvF "$1" ;;
33 (*)
34 echo "extract: '$1' cannot be extracted" >&2
35 success=1