mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +00:00
better args order, fmt
This commit is contained in:
parent
e26323bd99
commit
0ceb84d5cf
@ -86,8 +86,8 @@ pub fn build_archive_from_paths<W>(
|
||||
input_filenames: &[PathBuf],
|
||||
output_path: &Path,
|
||||
writer: W,
|
||||
quiet: bool,
|
||||
file_visibility_policy: FileVisibilityPolicy,
|
||||
quiet: bool,
|
||||
) -> crate::Result<W>
|
||||
where
|
||||
W: Write,
|
||||
|
@ -138,8 +138,8 @@ pub fn build_archive_from_paths<W>(
|
||||
input_filenames: &[PathBuf],
|
||||
output_path: &Path,
|
||||
writer: W,
|
||||
quiet: bool,
|
||||
file_visibility_policy: FileVisibilityPolicy,
|
||||
quiet: bool,
|
||||
) -> crate::Result<W>
|
||||
where
|
||||
W: Write + Seek,
|
||||
|
@ -75,7 +75,7 @@ pub fn compress_files(
|
||||
io::copy(&mut reader, &mut writer)?;
|
||||
}
|
||||
Tar => {
|
||||
archive::tar::build_archive_from_paths(&files, output_path, &mut writer, quiet, file_visibility_policy)?;
|
||||
archive::tar::build_archive_from_paths(&files, output_path, &mut writer, file_visibility_policy, quiet)?;
|
||||
writer.flush()?;
|
||||
}
|
||||
Zip => {
|
||||
@ -89,7 +89,13 @@ pub fn compress_files(
|
||||
|
||||
let mut vec_buffer = Cursor::new(vec![]);
|
||||
|
||||
archive::zip::build_archive_from_paths(&files, output_path, &mut vec_buffer, quiet, file_visibility_policy)?;
|
||||
archive::zip::build_archive_from_paths(
|
||||
&files,
|
||||
output_path,
|
||||
&mut vec_buffer,
|
||||
file_visibility_policy,
|
||||
quiet,
|
||||
)?;
|
||||
vec_buffer.rewind()?;
|
||||
io::copy(&mut vec_buffer, &mut writer)?;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ pub fn decompress_file(
|
||||
output_dir: &Path,
|
||||
output_file_path: PathBuf,
|
||||
question_policy: QuestionPolicy,
|
||||
quiet: bool
|
||||
quiet: bool,
|
||||
) -> crate::Result<()> {
|
||||
assert!(output_dir.exists());
|
||||
let reader = fs::File::open(input_file_path)?;
|
||||
|
@ -245,7 +245,14 @@ pub fn run(
|
||||
|
||||
for ((input_path, formats), file_name) in files.iter().zip(formats).zip(output_paths) {
|
||||
let output_file_path = output_dir.join(file_name); // Path used by single file format archives
|
||||
decompress_file(input_path, formats, &output_dir, output_file_path, question_policy, args.quiet)?;
|
||||
decompress_file(
|
||||
input_path,
|
||||
formats,
|
||||
&output_dir,
|
||||
output_file_path,
|
||||
question_policy,
|
||||
args.quiet,
|
||||
)?;
|
||||
}
|
||||
}
|
||||
Subcommand::List { archives: files, tree } => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user