
Package archiver makes it trivially easy to make and extract common archive formats such as .zip, and .tar.gz. Simply name the input and output file(s).
Files are put into the root of the archive; directories are recursively added, preserving structure.
The arc command runs the same cross-platform and has no external dependencies (not even libc); powered by the Go standard library, dsnet/compress, nwaples/rardecode, and ulikunitz/xz. Enjoy!
Supported formats/extensions:
Make a new archive:
# Syntax: arc archive [archive name] [input files...]
$ arc archive test.tar.gz file1.txt images/file2.jpg folder/subfolder
(At least one input file is required.)
To extract an archive:
# Syntax: arc unarchive [archive name] [destination]
$ arc unarchive test.tar.gz
(The destination path is optional; default is current directory.)
List archive contents
# Syntax: arc ls [archive name]
$ arc ls caddy_dist.tar.gz
drwxr-xr-x matt staff 0 2018-09-19 15:47:18 -0600 MDT dist/
-rw-r--r-- matt staff 6148 2017-08-07 18:34:22 -0600 MDT dist/.DS_Store
-rw-r--r-- matt staff 22481 2018-09-19 15:47:18 -0600 MDT dist/CHANGES.txt
-rw-r--r-- matt staff 17189 2018-09-19 15:47:18 -0600 MDT dist/EULA.txt
-rw-r--r-- matt staff 25261 2016-03-07 16:32:00 -0700 MST dist/LICENSES.txt
-rw-r--r-- matt staff 1017 2018-09-19 15:47:18 -0600 MDT dist/README.txt
-rw-r--r-- matt staff 288 2016-03-21 11:52:38 -0600 MDT dist/gitcookie.sh.enc
...
The archive name must end with a supported file extension - this is how it knows what kind of archive to make. Run archiver -h for more help.