use clap::{Parser, Subcommand}; #[derive( clap::ValueEnum, serde::Serialize, serde::Deserialize, Debug, Clone, Copy, PartialEq, Eq, )] #[serde(rename_all = "lowercase")] pub enum Backend { Tauri, Chromium, } #[derive( clap::ValueEnum, serde::Serialize, serde::Deserialize, Debug, Clone, Copy, PartialEq, Eq, )] #[serde(rename_all = "lowercase")] pub enum ProfileScope { #[serde(alias = "default")] Isolated, Shared, } #[derive(Debug, Clone)] pub struct BuildArgs { pub url: String, pub name: String, pub internal_id: String, pub icon: Option, pub fullscreen: bool, pub no_decorations: bool, pub user_agent: Option, pub width: Option, pub height: Option, pub dark_mode: bool, pub backend: Backend, pub browser_bin: Option, pub profile_scope: ProfileScope, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone)] pub struct DeskifyAppConfig { pub schema_version: u32, pub id: String, pub name: String, pub url: String, pub backend: Backend, pub browser_bin: Option, pub profile_scope: ProfileScope, pub fullscreen: bool, pub no_decorations: bool, pub user_agent: Option, pub width: Option, pub height: Option, pub dark_mode: bool, } #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] pub struct Cli { #[command(subcommand)] pub command: Commands, } #[derive(Subcommand, Debug)] pub enum Commands { Build { #[arg(short, long)] url: String, #[arg(short, long)] name: String, #[arg(short, long)] icon: Option, #[arg(short, long)] fullscreen: bool, #[arg(long)] no_decorations: bool, #[arg(short = 'A', long)] user_agent: Option, #[arg(short = 'W', long)] width: Option, #[arg(short = 'H', long)] height: Option, #[arg(short, long)] dark_mode: bool, #[arg(long, value_enum, default_value_t = Backend::Tauri)] backend: Backend, #[arg(long)] browser_bin: Option, #[arg(long, value_enum, default_value_t = ProfileScope::Isolated)] profile_scope: ProfileScope, #[arg(long)] print_config: bool, #[arg(long)] dry_run: bool, }, List { #[arg(long)] verbose: bool, }, Doctor, Remove { id: String, }, Update { id: String, #[arg(short, long)] url: Option, #[arg(short, long)] name: Option, #[arg(short, long)] icon: Option, #[arg(short, long, action = clap::ArgAction::SetTrue)] fullscreen: Option, #[arg(long, action = clap::ArgAction::SetTrue)] no_decorations: Option, #[arg(short = 'A', long)] user_agent: Option, #[arg(short = 'W', long)] width: Option, #[arg(short = 'H', long)] height: Option, #[arg(short, long, action = clap::ArgAction::SetTrue)] dark_mode: Option, #[arg(long, value_enum)] backend: Option, #[arg(long)] browser_bin: Option, #[arg(long, value_enum)] profile_scope: Option, #[arg(long)] dry_run: bool, #[arg(long)] print_config: bool, }, }