From ce5524775bb7a7f34f92ee732c7e4df29142cf00 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 23 Aug 2024 09:03:01 +0200 Subject: feat(cli): Add an explicit `subs export` subcommand This subcommand is functionally identical with the previous `subs list --url`, but semantically it improves the situation, by having symmetrical `import` and `export` subcommands. --- src/main.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 3852b8e..7852aa0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -108,17 +108,17 @@ async fn main() -> Result<()> { .await .context("Failed to remove a subscription")?; } - SubscriptionCommand::List { url } => { + SubscriptionCommand::List {} => { let all_subs = get_subscriptions(&app).await?; - if url { - for val in all_subs.0.values() { - println!("{}", val.url); - } - } else { - for (key, val) in all_subs.0 { - println!("{}: '{}'", key, val.url); - } + for (key, val) in all_subs.0 { + println!("{}: '{}'", key, val.url); + } + } + SubscriptionCommand::Export {} => { + let all_subs = get_subscriptions(&app).await?; + for val in all_subs.0.values() { + println!("{}", val.url); } } SubscriptionCommand::Import { file, force } => { -- cgit 1.4.1