pub const HELP: &str = "\
mermaidd — Mermaid's background daemon (durable runtime state, remote attach,
long-running process ownership).
Usage: mermaidd [--version | --help]
With no arguments it runs the daemon in the foreground, serving the control
socket (a Unix domain socket; an owner-locked named pipe on Windows). On Linux
it is normally managed via the `mermaid daemon` subcommands (install, start,
stop, restart, status, logs) rather than invoked directly.
";
#[derive(Debug, PartialEq, Eq)]
pub enum CliAction {
Run,
Version,
Help,
Unknown(String),
}
pub fn classify_args<I: IntoIterator<Item = String>>(args: I) -> CliAction {
match args.into_iter().next().as_deref() {
None => CliAction::Run,
Some("--version" | "-V" | "version") => CliAction::Version,
Some("--help" | "-h" | "help") => CliAction::Help,
Some(other) => CliAction::Unknown(other.to_string()),
}
}