ouch-org / ouch

Painless compression and decompression in the terminal
https://crates.io/crates/ouch
Other
2.18k stars 75 forks source link

Add symbol to represent the directory name #650

Open owenstake opened 5 months ago

owenstake commented 5 months ago

I usually compress directory to tgz with same basename in the following way.

ouch compress dir1 dir1.tgz

Sometimes dir1 is complex with special char, I don't like to repeat myself. Can ouch add syntax {} to represent the directory name? Expect as follows.

ouch compress dir1 {}.tgz
marcospb19 commented 5 months ago

We have a --format flag that works like this:

ouch compress LONG_NAME --format tar.gz OUTPUT_NAME

It could, in theory, not require the output file:

ouch compress LONG_NAME --format tar.gz

I need to think a bit more about this.

But here is a corner case, should Ouch panic if there are multiple input arguments?

ouch compress 1 2 3 4 5 {}.tgz
marcospb19 commented 1 week ago

@owenstake do you have any opinions on this?

But here is a corner case, should Ouch panic if there are multiple input arguments?

ouch compress 1 2 3 4 5 {}.tgz