zip-rs / zip-old

Zip implementation in Rust
MIT License
731 stars 204 forks source link

Use clap to parse args and add compression method argument in write_dir example #452

Closed allilo1 closed 5 months ago

allilo1 commented 5 months ago

In the write_dir example, the compression methods are iterated over in a loop and the resulting output zip file is repeatedly overwritten. Since ZStd is the last compression method in the loop, the output zip file is compressed using ZStd.

This change updates the write_dir example to use clap and adds the compression method as an argument. Deflated-Miniz and Deflated-Zlib are broken out as separate methods based on the specified feature. If the feature needed for the compression method is not specified, we exit from main with an error.

Picked up changes from zip-rs#426, and pinned the clap version.

Pr0methean commented 5 months ago

This repo is no longer maintained, so I've replaced this PR with https://github.com/zip-rs/zip2/pull/96.