src/bin/catar.rs: implement all-file-systems option
This commit is contained in:
parent
65092b1e27
commit
e3c30c50a6
@ -130,6 +130,7 @@ fn create_archive(
|
|||||||
let archive = tools::required_string_param(¶m, "archive")?;
|
let archive = tools::required_string_param(¶m, "archive")?;
|
||||||
let source = tools::required_string_param(¶m, "source")?;
|
let source = tools::required_string_param(¶m, "source")?;
|
||||||
let verbose = param["verbose"].as_bool().unwrap_or(false);
|
let verbose = param["verbose"].as_bool().unwrap_or(false);
|
||||||
|
let all_file_systems = param["all-file-systems"].as_bool().unwrap_or(false);
|
||||||
|
|
||||||
let source = std::path::PathBuf::from(source);
|
let source = std::path::PathBuf::from(source);
|
||||||
|
|
||||||
@ -143,7 +144,7 @@ fn create_archive(
|
|||||||
|
|
||||||
let mut writer = std::io::BufWriter::with_capacity(1024*1024, file);
|
let mut writer = std::io::BufWriter::with_capacity(1024*1024, file);
|
||||||
|
|
||||||
CaTarEncoder::encode(source, &mut dir, false, &mut writer, verbose)?;
|
CaTarEncoder::encode(source, &mut dir, all_file_systems, &mut writer, verbose)?;
|
||||||
|
|
||||||
writer.flush()?;
|
writer.flush()?;
|
||||||
|
|
||||||
@ -160,7 +161,8 @@ fn main() {
|
|||||||
.required("archive", StringSchema::new("Archive name"))
|
.required("archive", StringSchema::new("Archive name"))
|
||||||
.required("source", StringSchema::new("Source directory."))
|
.required("source", StringSchema::new("Source directory."))
|
||||||
.optional("verbose", BooleanSchema::new("Verbose output.").default(false))
|
.optional("verbose", BooleanSchema::new("Verbose output.").default(false))
|
||||||
))
|
.optional("all-file-systems", BooleanSchema::new("Include mounted sudirs.").default(false))
|
||||||
|
))
|
||||||
.arg_param(vec!["archive", "source"])
|
.arg_param(vec!["archive", "source"])
|
||||||
.completion_cb("archive", tools::complete_file_name)
|
.completion_cb("archive", tools::complete_file_name)
|
||||||
.completion_cb("source", tools::complete_file_name)
|
.completion_cb("source", tools::complete_file_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user