It sort of works... Peers are still disconnecting somehow

This commit is contained in:
Igor Katson 2021-06-26 21:00:17 +01:00
parent 47c5e9e0c4
commit 0f431621b9
5 changed files with 99 additions and 22 deletions

View file

@ -57,6 +57,10 @@ struct Opts {
/// Set if you are ok to write on top of existing files
#[clap(long)]
overwrite: bool,
/// Only list the torrent metadata contents, don't do anything else.
#[clap(short, long)]
list: bool,
}
fn compute_only_files(
@ -105,6 +109,9 @@ fn main() -> anyhow::Result<()> {
};
info!("Torrent metadata: {:#?}", &torrent);
if opts.list {
return Ok(());
}
let only_files = if let Some(filename_re) = opts.only_files_matching_regex {
Some(compute_only_files(&torrent, &filename_re)?)