From 6ec3f84a93ff2ba144d51e041f1d7cc11bbe8efb Mon Sep 17 00:00:00 2001 From: Candifloss Date: Mon, 29 Dec 2025 21:23:42 +0530 Subject: [PATCH] Move arg parsing to the CLI client --- crates/popcorn-d/Cargo.toml | 1 - crates/popcorn-d/src/main.rs | 8 +------- crates/popcorn/Cargo.toml | 5 ++++- crates/{popcorn-d => popcorn}/src/args.rs | 0 crates/popcorn/src/main.rs | 11 ++++++++++- 5 files changed, 15 insertions(+), 10 deletions(-) rename crates/{popcorn-d => popcorn}/src/args.rs (100%) diff --git a/crates/popcorn-d/Cargo.toml b/crates/popcorn-d/Cargo.toml index eb1ba64..9ada8f2 100644 --- a/crates/popcorn-d/Cargo.toml +++ b/crates/popcorn-d/Cargo.toml @@ -19,7 +19,6 @@ serde_json = "1.0.145" slint = { version = "1.14.1", default-features = false, features = ["backend-winit", "renderer-software", "compat-1-2"]} toml = "0.9.8" popcorn-conf = { path = "../popcorn-conf" } -clap = { version = "4.5.53", features = ["derive"] } serde = { version = "1.0.228", features = ["derive"] } [build-dependencies] diff --git a/crates/popcorn-d/src/main.rs b/crates/popcorn-d/src/main.rs index 7c04dc5..c80d785 100644 --- a/crates/popcorn-d/src/main.rs +++ b/crates/popcorn-d/src/main.rs @@ -1,13 +1,7 @@ -mod args; mod show_popup; -use args::{CliArgs, OsdArgs}; -use clap::Parser; - fn main() -> Result<(), Box> { - let cli = CliArgs::parse(); - let parsed_args: OsdArgs = cli.into(); - show_popup::show_popup(&parsed_args)?; + //show_popup::show_popup(/*&parsed_args*/)?; Ok(()) } diff --git a/crates/popcorn/Cargo.toml b/crates/popcorn/Cargo.toml index 2aa0a2b..47179a3 100644 --- a/crates/popcorn/Cargo.toml +++ b/crates/popcorn/Cargo.toml @@ -9,4 +9,7 @@ authors = ["Candifloss "] categories = ["Desktop", "CLI"] homepage = "https://git.candifloss.cc/candifloss/popcorn.git" keywords = ["OSD", "popup", "desktop", "cli"] -license = "GPL-3+" \ No newline at end of file +license = "GPL-3+" + +[dependencies] +clap = { version = "4.5.53", features = ["derive"] } \ No newline at end of file diff --git a/crates/popcorn-d/src/args.rs b/crates/popcorn/src/args.rs similarity index 100% rename from crates/popcorn-d/src/args.rs rename to crates/popcorn/src/args.rs diff --git a/crates/popcorn/src/main.rs b/crates/popcorn/src/main.rs index e7a11a9..69289d7 100644 --- a/crates/popcorn/src/main.rs +++ b/crates/popcorn/src/main.rs @@ -1,3 +1,12 @@ +mod args; + +use args::{CliArgs, OsdArgs}; +use clap::Parser; + fn main() { - println!("Hello, world!"); + let cli = CliArgs::parse(); + let parsed_args: OsdArgs = cli.into(); + + // Communicate with daemon + }