From f7e9e80f972deae401ab40e7afdf6ddd107b4d4c Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Thu, 6 Feb 2020 00:12:07 -0800 Subject: [PATCH] Show files in single-file mode Since it may be useful for scripting purposes, show file list, even for single-file torrents. type: changed --- justfile | 4 ++++ src/opt/torrent/show.rs | 2 ++ src/torrent_summary.rs | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 3dfe93d..cf74b0a 100644 --- a/justfile +++ b/justfile @@ -11,6 +11,10 @@ stats PATH: cargo build --release time ./target/release/imdl --unstable torrent stats --input {{PATH}} +push: check + ! git branch | grep '* master' + git push github + # clean up feature branch BRANCH done BRANCH: git checkout master diff --git a/src/opt/torrent/show.rs b/src/opt/torrent/show.rs index 779a560..e3d31be 100644 --- a/src/opt/torrent/show.rs +++ b/src/opt/torrent/show.rs @@ -84,6 +84,7 @@ Content Size 20 bytes Piece Size 16 KiB Piece Count 1 File Count 1 + Files foo "; assert_eq!(have, want); @@ -115,6 +116,7 @@ Trackers\tannounce\tb\tc Piece Size\t16384 Piece Count\t1 File Count\t1 +Files\tfoo "; assert_eq!(have, want); diff --git a/src/torrent_summary.rs b/src/torrent_summary.rs index 4ef331d..4246acd 100644 --- a/src/torrent_summary.rs +++ b/src/torrent_summary.rs @@ -130,7 +130,10 @@ impl TorrentSummary { table.row("Piece Count", self.metainfo.info.pieces.len() / 20); match &self.metainfo.info.mode { - Mode::Single { .. } => table.row("File Count", 1), + Mode::Single { .. } => { + table.row("File Count", 1); + table.row("Files", &self.metainfo.info.name); + } Mode::Multiple { files } => { table.row("File Count", files.len()); table.directory(