Move arg parsing to the CLI client

This commit is contained in:
Candifloss 2025-12-29 21:23:42 +05:30
parent 5207826108
commit 6ec3f84a93
5 changed files with 15 additions and 10 deletions

View File

@ -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"]} slint = { version = "1.14.1", default-features = false, features = ["backend-winit", "renderer-software", "compat-1-2"]}
toml = "0.9.8" toml = "0.9.8"
popcorn-conf = { path = "../popcorn-conf" } popcorn-conf = { path = "../popcorn-conf" }
clap = { version = "4.5.53", features = ["derive"] }
serde = { version = "1.0.228", features = ["derive"] } serde = { version = "1.0.228", features = ["derive"] }
[build-dependencies] [build-dependencies]

View File

@ -1,13 +1,7 @@
mod args;
mod show_popup; mod show_popup;
use args::{CliArgs, OsdArgs};
use clap::Parser;
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
let cli = CliArgs::parse();
let parsed_args: OsdArgs = cli.into();
show_popup::show_popup(&parsed_args)?; //show_popup::show_popup(/*&parsed_args*/)?;
Ok(()) Ok(())
} }

View File

@ -10,3 +10,6 @@ categories = ["Desktop", "CLI"]
homepage = "https://git.candifloss.cc/candifloss/popcorn.git" homepage = "https://git.candifloss.cc/candifloss/popcorn.git"
keywords = ["OSD", "popup", "desktop", "cli"] keywords = ["OSD", "popup", "desktop", "cli"]
license = "GPL-3+" license = "GPL-3+"
[dependencies]
clap = { version = "4.5.53", features = ["derive"] }

View File

@ -1,3 +1,12 @@
mod args;
use args::{CliArgs, OsdArgs};
use clap::Parser;
fn main() { fn main() {
println!("Hello, world!"); let cli = CliArgs::parse();
let parsed_args: OsdArgs = cli.into();
// Communicate with daemon
} }