Skip to content

Commit

Permalink
🚩 0.1.2: Readme updated and 7z, rar support
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Valenzuela committed Aug 15, 2021
1 parent 528beaa commit 5fbe71c
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 12 deletions.
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,41 @@ export TZAR_CONFIG=$PWD/config

## Configuration

TODO
Configuration is read from the standard directories for each OS (~/.config/tzar/*.toml). You
can add any number of toml files to that directory and they will all be read by tzar at runtime.

The configuration file has the following format:

``` toml
[command or format]
extract = "command extract ${verbose} ${filename} ${directory}"
compress = "command compress ${verbose} ${directory} ${filename}"
show = "command list ${verbose} ${filename}"
extensions = [".ext1". ".ext2"]
verbose = "-v"

[another command or format]
extract = "another x${verbose} ${filename} ${directory}"
compress = "another c${verbose} ${directory} ${filename}"
show = "another list ${verbose} ${filename}"
extensions = [".anoth"]
verbose = "v"
```

All commands should have the `extract`, `compress`, `show`, `extensions` and `verbose` values defined.
They are all self explanatory; they define templates for the commands to run, the extensions
for these commands, and how you can ask for a verbose output.

They can all contain the following template variables that will be replaced at runtime:

-`verbose`: Defines how and where to ask for a verbose output (defined in the `verbose =` variable definition).
-`filename`: The name of the compressed file. Corresponds to `<source>` in the `extract` and `list` subcommands, and to `<destination>` in the `compress` subcommand
-`directory`: The target directory. Corresponds to `<destination>` in the `extract` and `list` subcommands, and to `<source>` in the `compress` subcommand


## TODO

- [ ] Add a ton of new file formats
- [ ] Document config file
- [-] Add a ton of new file formats
- [ ] Document code
- [ ] Interactive prompt
- [ ] Tests (Don't judge, I'm coding this in the spare time I have during my lunch breaks.)
Expand Down
14 changes: 14 additions & 0 deletions config/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,17 @@ compress = "zip -r${verbose} ${filename} ${directory}"
show = "unzip -l${verbose} ${filename}"
extensions = [".zip"]
verbose = "v"

[7z]
extract = "7z x${verbose} ${filename} -o${directory}"
compress = "7z a${verbose} ${filename} ${directory}"
show = "7z l${verbose} ${filename}"
extensions = [".7z"]
verbose = ""

[rar]
extract = "unrar x${verbose} ${filename} ${directory}"
compress = "rar a${verbose} ${filename} ${directory}"
show = "unrar l${verbose} ${filename}"
extensions = [".rar"]
verbose = "v"
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[tool.poetry]
name = "tzar"
version = "0.1.1"
description = ""
version = "0.1.2"
description = "Manage: Tar, Zip, Anything Really!"
authors = ["Daniel Valenzuela <[email protected]>"]
readme = "README.md"
repository = "https://github.com/DanielVZ96/tzar"
keywords = ["compress", "extract", "tar", "zip"]

[tool.poetry.dependencies]
python = "^3.7"
Expand Down
4 changes: 2 additions & 2 deletions target-formats/archiving.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
File extension(s)[1] ,Official name[3]
File extension(s)[1] ,Official name[3], done
".a, .ar ",Unix Archiver
.cpio ,cpio
.shar ,Shell archive
Expand All @@ -7,4 +7,4 @@ File extension(s)[1] ,Official name[3]
.lbr ,
.mar ,Mozilla ARchive
.sbx ,SeqBox
.tar ,Tape archive
.tar ,Tape archive , x
2 changes: 1 addition & 1 deletion target-formats/both.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
File extension(s)[1] ,Official name[3]
.7z ,7z
.7z ,7z , x
.s7z ,7zX
.ace ,ACE
.afa ,AFA
Expand Down
8 changes: 4 additions & 4 deletions target-formats/compression.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
File extension(s)[1] ,Official name[3]
.bz2 ,bzip2
".F, .?XF[5] ",Freeze/melt [1]
.gz ,gzip
.bz2 ,bzip2 , x
".F, .?XF[5] ",Freeze/melt [1] ,
.gz ,gzip , x
.lz ,lzip
.lz4 ,LZ4
.lzma ,lzma
Expand All @@ -11,7 +11,7 @@ File extension(s)[1] ,Official name[3]
.sz ,Snappy
.?Q? ,SQ
.?Z? ,CRUNCH
.xz ,xz
.xz ,xz ,x
.z ,pack
.Z ,compress
.zst ,Zstandard
Expand Down

0 comments on commit 5fbe71c

Please sign in to comment.