Fix a bug

This commit is contained in:
Igor Katson 2021-07-31 13:13:04 +01:00
parent 175d5c7a97
commit b301b159da
4 changed files with 24 additions and 20 deletions

View file

@ -321,6 +321,18 @@ async fn main_torrent_info(
};
if opts.list {
for (idx, (filename, len)) in info.iter_filenames_and_lengths()?.enumerate() {
let included = match &only_files {
Some(files) => files.contains(&idx),
None => true,
};
info!(
"File {}, size {}{}",
filename.to_string()?,
SF::new(len),
if included { "" } else { "will skip" }
)
}
info!("--list was passed, nothing to do, exiting.");
return Ok(());
}