use clap::{Subcommand, ValueEnum};
use map_core::folders::Folder;
use pbap_core::phonebook::PhonebookPath;
#[derive(Subcommand, Debug)]
pub(crate) enum BrokerCmd {
Status,
}
#[derive(Subcommand, Debug)]
pub(crate) enum DaemonCmd {
Start {
#[arg(long)]
foreground: bool,
},
Stop,
Status,
Install {
#[arg(long)]
system: bool,
},
Uninstall {
#[arg(long)]
system: bool,
},
}
#[derive(Subcommand, Debug)]
pub(crate) enum ConfigCmd {
Show,
SetDevice {
address: String,
},
}
#[derive(Subcommand, Debug)]
pub(crate) enum SpokeCmd {
Add {
key: String,
},
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, ValueEnum)]
pub(crate) enum FolderArg {
Inbox,
Sent,
Outbox,
Deleted,
}
pub(crate) const fn folder_of(arg: Option<FolderArg>) -> Folder {
match arg {
Some(FolderArg::Inbox) | None => Folder::Inbox,
Some(FolderArg::Sent) => Folder::Sent,
Some(FolderArg::Outbox) => Folder::Outbox,
Some(FolderArg::Deleted) => Folder::Deleted,
}
}
pub(crate) const fn path_of(arg: PathArg) -> PhonebookPath {
match arg {
PathArg::Pb => PhonebookPath::Pb,
PathArg::Ich => PhonebookPath::Ich,
PathArg::Och => PhonebookPath::Och,
PathArg::Mch => PhonebookPath::Mch,
PathArg::Cch => PhonebookPath::Cch,
PathArg::Spd => PhonebookPath::Spd,
PathArg::Fav => PhonebookPath::Fav,
}
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, ValueEnum)]
pub(crate) enum PathArg {
Pb,
Ich,
Och,
Mch,
Cch,
Spd,
Fav,
}