diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2020-05-14 03:47:54 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 03:47:54 +0000 |
commit | e1ed1a807ca65cea8b19bf4d12df12aa45c9826a (patch) | |
tree | 63e9c44cff4e896a948111ed6330270cd3101111 /src/args.rs | |
parent | Merge pull request #301 from svenstaro/dependabot/cargo/serde-1.0.110 (diff) | |
parent | rename variables correctly (diff) | |
download | miniserve-e1ed1a807ca65cea8b19bf4d12df12aa45c9826a.tar.gz miniserve-e1ed1a807ca65cea8b19bf4d12df12aa45c9826a.zip |
Merge pull request #297 from marawan31/add-zip-download
Add zip download functionality for windows users
Diffstat (limited to 'src/args.rs')
-rw-r--r-- | src/args.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/args.rs b/src/args.rs index 49fe276..ea4e90f 100644 --- a/src/args.rs +++ b/src/args.rs @@ -84,9 +84,15 @@ struct CLIArgs { #[structopt(short = "o", long = "overwrite-files")] overwrite_files: bool, - /// Disable archive generation - #[structopt(short = "r", long = "disable-archives")] - disable_archives: bool, + /// Enable tar archive generation + #[structopt(short = "r", long = "enable-tar")] + enable_tar: bool, + + /// Enable zip archive generation + /// Zipping large directories can result in out-of-memory exception + /// because zip generation is done in memory and cannot be sent on the fly + #[structopt(short = "z", long = "enable-zip")] + enable_zip: bool, } /// Checks wether an interface is valid, i.e. it can be parsed into an IP address @@ -176,7 +182,8 @@ pub fn parse_args() -> crate::MiniserveConfig { index: args.index, overwrite_files: args.overwrite_files, file_upload: args.file_upload, - archives: !args.disable_archives, + tar_enabled: args.enable_tar, + zip_enabled: args.enable_zip, } } |