diff options
author | Dean Li <deantvv@gmail.com> | 2021-04-11 03:00:16 +0000 |
---|---|---|
committer | Dean Li <deantvv@gmail.com> | 2021-04-11 03:00:16 +0000 |
commit | 2bae301ed8efcf4239849a45b94cdc42e398b905 (patch) | |
tree | 06cfbebfc33cca930a80b9c080de3af1dcfdc815 /src/main.rs | |
parent | Merge pull request #488 from svenstaro/dependabot/cargo/http-0.2.4 (diff) | |
download | miniserve-2bae301ed8efcf4239849a45b94cdc42e398b905.tar.gz miniserve-2bae301ed8efcf4239849a45b94cdc42e398b905.zip |
Separate tar archive and tar flags
It used to have one flag (-r) to enable both tar archive and tar.
Now it has two flags [ -r: for tar, -g: for tar archive].
Related to #451
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 84a4cb8..a00ac3c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -90,9 +90,12 @@ pub struct MiniserveConfig { /// Enable upload to override existing files pub overwrite_files: bool, - /// If false, creation of tar archives is disabled + /// If false, creation of tar is disabled pub tar_enabled: bool, + /// If false, creation of tar archives is disabled + pub tar_archive_enabled: bool, + /// If false, creation of zip archives is disabled pub zip_enabled: bool, @@ -161,6 +164,7 @@ impl MiniserveConfig { show_qrcode: args.qrcode, file_upload: args.file_upload, tar_enabled: args.enable_tar, + tar_archive_enabled: args.enable_tar_archive, zip_enabled: args.enable_zip, dirs_first: args.dirs_first, title: args.title, @@ -411,6 +415,7 @@ fn configure_app(app: &mut web::ServiceConfig, conf: &MiniserveConfig) { let show_qrcode = conf.show_qrcode; let file_upload = conf.file_upload; let tar_enabled = conf.tar_enabled; + let tar_archive_enabled = conf.tar_archive_enabled; let zip_enabled = conf.zip_enabled; let dirs_first = conf.dirs_first; let hide_version_footer = conf.hide_version_footer; @@ -453,6 +458,7 @@ fn configure_app(app: &mut web::ServiceConfig, conf: &MiniserveConfig) { show_qrcode, u_r.clone(), tar_enabled, + tar_archive_enabled, zip_enabled, dirs_first, hide_version_footer, |