Default snapshot compression is now included in --help output
This commit is contained in:
committed by
mergify[bot]
parent
ae7b15f062
commit
bdf5274d18
@ -897,6 +897,7 @@ pub fn main() {
|
|||||||
Arg::with_name("snapshot_compression")
|
Arg::with_name("snapshot_compression")
|
||||||
.long("snapshot-compression")
|
.long("snapshot-compression")
|
||||||
.possible_values(&["bz2", "gzip", "zstd", "none"])
|
.possible_values(&["bz2", "gzip", "zstd", "none"])
|
||||||
|
.default_value("zstd")
|
||||||
.value_name("COMPRESSION_TYPE")
|
.value_name("COMPRESSION_TYPE")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("Type of snapshot compression to use."),
|
.help("Type of snapshot compression to use."),
|
||||||
@ -1063,16 +1064,17 @@ pub fn main() {
|
|||||||
exit(1);
|
exit(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
let mut snapshot_compression = CompressionType::Zstd;
|
let snapshot_compression = {
|
||||||
if let Ok(compression_str) = value_t!(matches, "snapshot_compression", String) {
|
let compression_str = value_t_or_exit!(matches, "snapshot_compression", String);
|
||||||
match compression_str.as_str() {
|
match compression_str.as_str() {
|
||||||
"bz2" => snapshot_compression = CompressionType::Bzip2,
|
"bz2" => CompressionType::Bzip2,
|
||||||
"gzip" => snapshot_compression = CompressionType::Gzip,
|
"gzip" => CompressionType::Gzip,
|
||||||
"zstd" => snapshot_compression = CompressionType::Zstd,
|
"zstd" => CompressionType::Zstd,
|
||||||
"none" => snapshot_compression = CompressionType::NoCompression,
|
"none" => CompressionType::NoCompression,
|
||||||
_ => panic!("Compression type not recognized: {}", compression_str),
|
_ => panic!("Compression type not recognized: {}", compression_str),
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
let snapshot_version =
|
let snapshot_version =
|
||||||
matches
|
matches
|
||||||
.value_of("snapshot_version")
|
.value_of("snapshot_version")
|
||||||
|
Reference in New Issue
Block a user