From 2bae301ed8efcf4239849a45b94cdc42e398b905 Mon Sep 17 00:00:00 2001 From: Dean Li Date: Sun, 11 Apr 2021 11:00:16 +0800 Subject: 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 --- src/archive.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/archive.rs') diff --git a/src/archive.rs b/src/archive.rs index 4df3a31..28d26b5 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -53,10 +53,15 @@ impl CompressionMethod { } } - pub fn is_enabled(self, tar_enabled: bool, zip_enabled: bool) -> bool { + pub fn is_enabled( + self, + tar_enabled: bool, + tar_archive_enabled: bool, + zip_enabled: bool, + ) -> bool { match self { - CompressionMethod::TarGz => tar_enabled, CompressionMethod::Tar => tar_enabled, + CompressionMethod::TarGz => tar_archive_enabled, CompressionMethod::Zip => zip_enabled, } } -- cgit v1.2.3 From c9506c72ff368867982d138a686648fa302b116d Mon Sep 17 00:00:00 2001 From: Dean Li Date: Sun, 18 Apr 2021 11:22:52 +0800 Subject: Change naming of uncompressed/compressed tarballs Use following terminology: uncompressed tarballs => `uncompressed tar archives` compressed ones => `gz-compressed tar archives` --- src/archive.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/archive.rs') diff --git a/src/archive.rs b/src/archive.rs index 28d26b5..e53aea8 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -53,15 +53,10 @@ impl CompressionMethod { } } - pub fn is_enabled( - self, - tar_enabled: bool, - tar_archive_enabled: bool, - zip_enabled: bool, - ) -> bool { + pub fn is_enabled(self, tar_enabled: bool, tar_gz_enabled: bool, zip_enabled: bool) -> bool { match self { + CompressionMethod::TarGz => tar_gz_enabled, CompressionMethod::Tar => tar_enabled, - CompressionMethod::TarGz => tar_archive_enabled, CompressionMethod::Zip => zip_enabled, } } -- cgit v1.2.3