mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-04-20 11:54:23 +02:00
20 lines
547 B
Rust
20 lines
547 B
Rust
|
use crate::ipc::commands::Command;
|
||
|
use crate::ipc::responses::Response;
|
||
|
use clap::Parser;
|
||
|
use serde::{Deserialize, Serialize};
|
||
|
|
||
|
#[derive(Parser, Debug, Serialize, Deserialize)]
|
||
|
#[command(version)]
|
||
|
pub struct Args {
|
||
|
#[command(subcommand)]
|
||
|
pub command: Option<Command>,
|
||
|
}
|
||
|
|
||
|
pub fn handle_response(response: Response) {
|
||
|
match response {
|
||
|
Response::Ok => println!("ok"),
|
||
|
Response::OkValue { value } => println!("ok\n{value}"),
|
||
|
Response::Err { message } => eprintln!("error\n{}", message.unwrap_or_default()),
|
||
|
}
|
||
|
}
|