shorten CLI timezone flags, add docs

This commit is contained in:
ThetaDev 2025-02-06 14:28:37 +01:00
parent 9890538c0e
commit c87bac1856
No known key found for this signature in database
GPG key ID: E319D3C5148D65B6
2 changed files with 11 additions and 5 deletions

View file

@ -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. `--auth` flag you can use authentication for any request.
- `--lang` Change the YouTube content language - `--lang` Change the YouTube content language
- `--country` Change the YouTube content country - `--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` - `--report` Generate a report on every request and store it in a `rustypipe_reports`
folder in the current directory folder in the current directory
- `--cache-file` Change the RustyPipe cache file location (Default: - `--cache-file` Change the RustyPipe cache file location (Default:

View file

@ -55,13 +55,13 @@ struct Cli {
/// YouTube content country /// YouTube content country
#[clap(long, global = true)] #[clap(long, global = true)]
country: Option<String>, country: Option<String>,
/// UTC offset in minutes /// Use a specific timezone (e.g. Europe/Berlin, Australia/Sydney)
#[cfg(feature = "timezone")] #[cfg(feature = "timezone")]
#[clap(long, global = true)] #[clap(long, global = true)]
timezone: Option<String>, tz: Option<String>,
/// Use local timezone /// Use local timezone
#[clap(long, global = true)] #[clap(long, global = true)]
timezone_local: bool, tz_local: bool,
/// Use authentication /// Use authentication
#[clap(long, global = true)] #[clap(long, global = true)]
auth: bool, auth: bool,
@ -920,12 +920,12 @@ async fn run() -> anyhow::Result<()> {
if let Some(botguard_bin) = cli.botguard_bin { if let Some(botguard_bin) = cli.botguard_bin {
rp = rp.botguard_bin(botguard_bin); rp = rp.botguard_bin(botguard_bin);
} }
if cli.timezone_local { if cli.tz_local {
rp = rp.timezone_local(); rp = rp.timezone_local();
} }
#[cfg(feature = "timezone")] #[cfg(feature = "timezone")]
if let Some(timezone) = cli.timezone { if let Some(timezone) = cli.tz {
use time::OffsetDateTime; use time::OffsetDateTime;
use time_tz::{Offset, TimeZone}; use time_tz::{Offset, TimeZone};