From 29816f80efaced689a99be5047b272af27f61bce Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 7 Jun 2025 17:04:12 +0300 Subject: [PATCH] rename argument `torrents_path` to `storage`, `infohash_source` to `infohash_file` (reserve namespace for the URL sources) --- README.md | 16 ++++++++-------- src/argument.rs | 12 ++++++------ src/main.rs | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index d464dc5..8fbca86 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,12 @@ Crawler/aggregation tool for the [Aquatic](https://github.com/greatest-ape/aquat ## Usage ``` bash -aquatic-crawler --infohash-source /path/to/info-hash-ipv4.json\ - --infohash-source /path/to/info-hash-ipv6.json\ - --infohash-source /path/to/another-source.json\ +aquatic-crawler --infohash-file /path/to/info-hash-ipv4.json\ + --infohash-file /path/to/info-hash-ipv6.json\ + --infohash-file /path/to/another-source.json\ --torrent-tracker udp://host1:port\ --torrent-tracker udp://host2:port\ - --torrents-path /path/to/storage + --storage /path/to/storage ``` * all arguments are optional, to support multiple source and target drivers * running without arguments does nothing! @@ -54,13 +54,13 @@ aquatic-crawler --infohash-source /path/to/info-hash-ipv4.json\ -c, --clear Clear previous index collected on crawl session start --i, --infohash-source - Filepath(s) to the Aquatic tracker info-hash JSON/API +--infohash-file + Absolute filename(s) to the Aquatic tracker info-hash JSON/API * PR#233 feature ---torrents-path - Directory path to store the `.torrent` files +--storage + Directory path to store reload data (e.g. `.torrent` files) --torrent-tracker Define custom tracker(s) to preload the `.torrent` files info diff --git a/src/argument.rs b/src/argument.rs index 1243627..24fbc57 100644 --- a/src/argument.rs +++ b/src/argument.rs @@ -14,15 +14,15 @@ pub struct Argument { #[arg(short, long, default_value_t = false)] pub clear: bool, - /// Filepath(s) to the Aquatic tracker info-hash JSON/API + /// Absolute filename(s) to the Aquatic tracker info-hash JSON/API /// /// * PR#233 feature - #[arg(short, long)] - pub infohash_source: Vec, - - /// Directory path to store the `.torrent` files #[arg(long)] - pub torrents_path: Option, + pub infohash_file: Vec, + + /// Directory path to store reload data (e.g. `.torrent` files) + #[arg(long)] + pub storage: Option, /// Define custom tracker(s) to preload the `.torrent` files info #[arg(long)] diff --git a/src/main.rs b/src/main.rs index c282809..c66128c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ async fn main() -> anyhow::Result<()> { let is_debug_e = argument.debug.contains("e"); // init shared members - let torrent_storage = if let Some(t) = argument.torrents_path { + let torrent_storage = if let Some(t) = argument.storage { let s = database::torrent::Storage::init(&t, argument.clear)?; if argument.clear && is_debug_i { debug::info(String::from("Cleanup torrent storage")); @@ -59,7 +59,7 @@ async fn main() -> anyhow::Result<()> { ) .await?; // collect info-hashes from API - for source in &argument.infohash_source { + for source in &argument.infohash_file { if is_debug_i { debug::info(format!("Handle info-hash source `{source}`...")); }