Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
a4f08ad2
Unverified
Commit
a4f08ad2
authored
Feb 22, 2023
by
Filippo Bonazzi
Committed by
GitHub
Feb 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(extract): support `obscpio` format (#11511)
Co-authored-by:
Carlo Sala
<
carlosalag@protonmail.com
>
parent
9f9d3b7d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
README.md
plugins/extract/README.md
+8
-7
_extract
plugins/extract/_extract
+1
-1
extract.plugin.zsh
plugins/extract/extract.plugin.zsh
+1
-1
No files found.
plugins/extract/README.md
View file @
a4f08ad2
# extract plugin
# extract plugin
This plugin defines a function called
`extract`
that extracts the archive file
This plugin defines a function called
`extract`
that extracts the archive file
you pass it, and it supports a
you pass it, and it supports a
wide variety of archive filetypes.
wide variety of archive filetypes.
This way you don't have to know what specific command extracts a file, you just
This way you don't have to know what specific command extracts a file, you just
do
`extract <filename>`
and
do
`extract <filename>`
and
the function takes care of the rest.
the function takes care of the rest.
To use it, add
`extract`
to the plugins array in your zshrc file:
To use it, add
`extract`
to the plugins array in your zshrc file:
...
@@ -15,7 +15,7 @@ plugins=(... extract)
...
@@ -15,7 +15,7 @@ plugins=(... extract)
## Supported file extensions
## Supported file extensions
| Extension | Description |
| Extension | Description |
|
:------------------|:-------------------------------------
|
|
:---------------- | :-----------------------------------
|
|
`7z`
| 7zip file |
|
`7z`
| 7zip file |
|
`Z`
| Z archive (LZW) |
|
`Z`
| Z archive (LZW) |
|
`apk`
| Android app file |
|
`apk`
| Android app file |
...
@@ -32,6 +32,7 @@ plugins=(... extract)
...
@@ -32,6 +32,7 @@ plugins=(... extract)
|
`lrz`
| LRZ archive |
|
`lrz`
| LRZ archive |
|
`lz4`
| LZ4 archive |
|
`lz4`
| LZ4 archive |
|
`lzma`
| LZMA archive |
|
`lzma`
| LZMA archive |
|
`obscpio`
| cpio archive used on OBS |
|
`rar`
| WinRAR archive |
|
`rar`
| WinRAR archive |
|
`rpm`
| RPM package |
|
`rpm`
| RPM package |
|
`sublime-package`
| Sublime Text package |
|
`sublime-package`
| Sublime Text package |
...
@@ -57,5 +58,5 @@ plugins=(... extract)
...
@@ -57,5 +58,5 @@ plugins=(... extract)
|
`zst`
| Zstandard file (zstd) |
|
`zst`
| Zstandard file (zstd) |
|
`zpaq`
| Zpaq file |
|
`zpaq`
| Zpaq file |
See
[
list of archive formats
](
https://en.wikipedia.org/wiki/List_of_archive_formats
)
for
See
[
list of archive formats
](
https://en.wikipedia.org/wiki/List_of_archive_formats
)
for
more information
more information
regarding archive formats.
regarding archive formats.
plugins/extract/_extract
View file @
a4f08ad2
...
@@ -3,5 +3,5 @@
...
@@ -3,5 +3,5 @@
_arguments \
_arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
"*::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|zpaq)(-.)'" \
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|cab|cpio|deb|ear|gz|ipa|ipsw|jar|lrz|lz4|lzma|
obscpio|
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|zpaq)(-.)'" \
&& return 0
&& return 0
plugins/extract/extract.plugin.zsh
View file @
a4f08ad2
...
@@ -72,7 +72,7 @@ EOF
...
@@ -72,7 +72,7 @@ EOF
builtin cd
-q
..
;
command rm
*
.tar.
*
debian-binary
;;
builtin cd
-q
..
;
command rm
*
.tar.
*
debian-binary
;;
(
*
.zst
)
unzstd
"
$file
"
;;
(
*
.zst
)
unzstd
"
$file
"
;;
(
*
.cab
)
cabextract
-d
"
$extract_dir
"
"
$file
"
;;
(
*
.cab
)
cabextract
-d
"
$extract_dir
"
"
$file
"
;;
(
*
.cpio
)
cpio
-idmvF
"
$file
"
;;
(
*
.cpio
|
*
.obscpio
)
cpio
-idmvF
"
$file
"
;;
(
*
.zpaq
)
zpaq x
"
$file
"
;;
(
*
.zpaq
)
zpaq x
"
$file
"
;;
(
*
)
(
*
)
echo
"extract: '
$file
' cannot be extracted"
>
&2
echo
"extract: '
$file
' cannot be extracted"
>
&2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment