From c87bac18563683b74e441bc25ae027cc5b3b991b Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Thu, 6 Feb 2025 14:28:37 +0100 Subject: [PATCH] shorten CLI timezone flags, add docs --- cli/README.md | 6 ++++++ cli/src/main.rs | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cli/README.md b/cli/README.md index b4056c4..28c34a4 100644 --- a/cli/README.md +++ b/cli/README.md @@ -135,6 +135,12 @@ Fetch a list of all the items saved in your YouTube/YouTube Music profile. `--auth` flag you can use authentication for any request. - `--lang` Change the YouTube content language - `--country` Change the YouTube content country +- `--tz` Use a specific + [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) (e.g. + Europe/Berlin, Australia/Sydney) + + **Note:** this requires building rustypipe-cli with the `timezone` feature +- `--local-tz` Use the local timezone instead of UTC - `--report` Generate a report on every request and store it in a `rustypipe_reports` folder in the current directory - `--cache-file` Change the RustyPipe cache file location (Default: diff --git a/cli/src/main.rs b/cli/src/main.rs index 1940ed0..f192dd8 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -55,13 +55,13 @@ struct Cli { /// YouTube content country #[clap(long, global = true)] country: Option, - /// UTC offset in minutes + /// Use a specific timezone (e.g. Europe/Berlin, Australia/Sydney) #[cfg(feature = "timezone")] #[clap(long, global = true)] - timezone: Option, + tz: Option, /// Use local timezone #[clap(long, global = true)] - timezone_local: bool, + tz_local: bool, /// Use authentication #[clap(long, global = true)] auth: bool, @@ -920,12 +920,12 @@ async fn run() -> anyhow::Result<()> { if let Some(botguard_bin) = cli.botguard_bin { rp = rp.botguard_bin(botguard_bin); } - if cli.timezone_local { + if cli.tz_local { rp = rp.timezone_local(); } #[cfg(feature = "timezone")] - if let Some(timezone) = cli.timezone { + if let Some(timezone) = cli.tz { use time::OffsetDateTime; use time_tz::{Offset, TimeZone};