about summary refs log tree commit diff stats
path: root/src/main.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-23 09:03:01 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-23 09:03:01 +0200
commitce5524775bb7a7f34f92ee732c7e4df29142cf00 (patch)
tree8ce8b3fcd3682de5a6950b5088ebf475e0814a9b /src/main.rs
parentfix(storage/schema.sql): Tell SQLite to perform type-checking (diff)
downloadyt-ce5524775bb7a7f34f92ee732c7e4df29142cf00.tar.gz
yt-ce5524775bb7a7f34f92ee732c7e4df29142cf00.zip
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.
Diffstat (limited to '')
-rw-r--r--src/main.rs18
1 files changed, 9 insertions, 9 deletions
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 } => {