mermaid_cli/mermaidd/
cli.rs1pub const HELP: &str = "\
4mermaidd — Mermaid's background daemon (durable runtime state, remote attach,
5long-running process ownership).
6
7Usage: mermaidd [--version | --help]
8
9With no arguments it runs the daemon in the foreground, serving the control
10socket (a Unix domain socket; an owner-locked named pipe on Windows). On Linux
11it is normally managed via the `mermaid daemon` subcommands (install, start,
12stop, restart, status, logs) rather than invoked directly.
13";
14
15#[derive(Debug, PartialEq, Eq)]
16pub enum CliAction {
17 Run,
18 Version,
19 Help,
20 Unknown(String),
21}
22
23pub fn classify_args<I: IntoIterator<Item = String>>(args: I) -> CliAction {
30 match args.into_iter().next().as_deref() {
31 None => CliAction::Run,
32 Some("--version" | "-V" | "version") => CliAction::Version,
33 Some("--help" | "-h" | "help") => CliAction::Help,
34 Some(other) => CliAction::Unknown(other.to_string()),
35 }
36}