1use std::path::PathBuf;
2
3#[derive(Clone, Copy, Debug, PartialEq, Eq, clap::ValueEnum)]
4pub enum InitChoice {
5 Auto,
6 Systemd,
7 Openrc,
8 Runit,
9 Windows,
10}
11
12#[derive(Clone, Debug, clap::Subcommand)]
13pub enum Action {
14 #[command(about = "Register, configure and start the system service")]
15 Install {
16 #[arg(long, value_enum, default_value = "auto")]
17 init: InitChoice,
18 },
19 #[command(about = "Rewrite the service registration and restart it")]
20 Update,
21 #[command(about = "Stop and remove the service registration")]
22 Uninstall {
23 #[arg(long, help = "Also remove data, configuration and the service account")]
24 purge: bool,
25 },
26 #[command(about = "Print init kind, registration and run state as JSON")]
27 Status,
28}
29
30#[derive(Clone, Debug, Default)]
31pub struct Host {
32 pub sudo_user: String,
33 pub sudo_uid: String,
34 pub pkexec_uid: String,
35 pub binary: PathBuf,
36}