Armin Friedl
bde99e3ede
archive_read_free also frees archive_entries. Avoid double-free by removing manual free'ing of entry. |
||
---|---|---|
doc | ||
src | ||
subprojects | ||
test | ||
.clang-format | ||
.drone.yml | ||
.gitignore | ||
meson.build | ||
README.md |
XWIM
Do What I Mean Extractor
Continuing the emacs tradition of "Do What I Mean" tools, dtrx is a replacement
for the excellent, but unfortunately unmaintained,
dtrx. xwim
is a command line tool that
targets two problems with archives:
- Command line tools for extracting archives are often archaic and differ considerably between formats
- Inconsiderately packaged archives tend to spill their content over the directory they are extracted to
Usage
Invoking xwim
is as simple as:
xim archive.tar.gz
This will extract the archive archive.tar.gz
to the current folder. If the
archive contains a single root folder named like the archive, it is just
extracted as is. Otherwise xwim
first creates a folder named after the archive
and extracts the contents there.
Examples
Single root folder named after the archive
archive.tar.gz
|
-- archive/
|
-- file.txt
|
-- file2.txt
xwim
will just extract the archive to the current directory.
Multiple files/folders in archive root
archive.tar.gz
|
-- archive/
| |
| -- file.txt
|
-- file2.txt
xwim
will create a folder archive
in the current directory and extract the
archive contents there.
Supported formats
xwim
is indifferent to the actual extraction backend. However, currently only
libarchive is supported. xwim
supports most formats
supported by libarchive
:
- 7-zip: 7z, 7zip
- zip: jar, zip
- bzip2: bz2, bzip2
- gzip: gz, gzip
- xzip: xz
- rar: rar
- tar with compression: tgz, tar.gz, tar.bz2, tar.xz