use std::time::Duration;
#[allow(
clippy::missing_docs_in_private_items,
reason = "split-out module keeps the file under the linecheck limit"
)]
mod wants_quiet;
pub(crate) use wants_quiet::*;
#[allow(
clippy::missing_docs_in_private_items,
reason = "split-out module keeps the file under the linecheck limit"
)]
mod stop_json;
pub(crate) use stop_json::*;
pub(crate) const DAEMONIZED_ENV: &str = "MOADIM_DAEMONIZED";
pub const EXIT_NOT_RUNNING: i32 = 3;
pub const EXIT_USAGE: i32 = 2;
const fn liveness_exit_code(running: bool) -> i32 {
if running {
0
} else {
EXIT_NOT_RUNNING
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Command {
Foreground,
Background,
Restart {
json: bool,
quiet: bool,
interactive: bool,
},
Stop {
json: bool,
quiet: bool,
},
Status {
json: bool,
wait_secs: Option<u64>,
},
Cleanup {
json: bool,
},
Trigger {
id: String,
},
Logs {
id: String,
},
Install,
Uninstall,
Help,
Usage(String),
Version,
Completions(Option<String>),
Data(Vec<String>),
Machine(Vec<String>),
}
pub(crate) const DATA_COMMANDS: &[&str] = &["routines", "schedule", "agents", "enable", "disable"];
include!("wants_json.rs");