Do What I Mean Extractor
Find a file
Armin Friedl e7a0b1b6bd
All checks were successful
continuous-integration/drone/push Build is passing
Update readme
2020-03-05 23:14:05 +01:00
doc Add tests 2020-02-25 23:01:41 +01:00
src Add tests 2020-02-25 23:01:41 +01:00
subprojects Add tests 2020-02-25 23:01:41 +01:00
test Add tests 2020-02-25 23:01:41 +01:00
.clang-format Init 2020-02-16 03:20:12 +01:00
.drone.yml Add tests 2020-02-25 23:01:41 +01:00
.gitignore [fix] Extractor falls out of scope 2020-02-23 09:56:33 +01:00
meson.build Add tests 2020-02-25 23:01:41 +01:00
README.md Update readme 2020-03-05 23:14:05 +01:00

Build Status

XWIM

Do What I Mean Extractor

https://xkcd.com/1168/

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