1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
mod restart;
mod setup;
mod shutdown;

use anyhow::Result;
use clap::Subcommand;

use self::{restart::server_restart, setup::server_setup, shutdown::server_shutdown};

#[derive(Debug, Subcommand)]
pub enum ServerCommand {
    Restart,
    Setup,
    Shutdown,
}

pub fn handle_command_server(command: ServerCommand) -> Result<()> {
    match command {
        ServerCommand::Restart => server_restart(),
        ServerCommand::Setup => server_setup(),
        ServerCommand::Shutdown => server_shutdown(),
    }
}