refactor!: initial commit, setup cli
This commit is contained in:
29
nix/homelab/cli/src/commands/minecraft.rs
Normal file
29
nix/homelab/cli/src/commands/minecraft.rs
Normal file
@@ -0,0 +1,29 @@
|
||||
use clap::{Args, Subcommand};
|
||||
use kube::Api;
|
||||
|
||||
use crate::{AppState, State};
|
||||
|
||||
#[derive(Debug, Args)]
|
||||
pub struct MinecraftCommand {
|
||||
#[command(subcommand)]
|
||||
command: MinecraftSubcommand,
|
||||
}
|
||||
|
||||
#[derive(Debug, Subcommand)]
|
||||
enum MinecraftSubcommand {
|
||||
Backup {
|
||||
/// the world to backup
|
||||
#[arg(short, long)]
|
||||
world: String,
|
||||
},
|
||||
}
|
||||
|
||||
impl MinecraftCommand {
|
||||
pub async fn run(&self, app_state: State) {
|
||||
match &self.command {
|
||||
MinecraftSubcommand::Backup { world } => backup_world(app_state, &world),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn backup_world(app_state: State, world: &str) {}
|
||||
8
nix/homelab/cli/src/commands/mod.rs
Normal file
8
nix/homelab/cli/src/commands/mod.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
use clap::Subcommand;
|
||||
mod minecraft;
|
||||
|
||||
#[derive(Subcommand, Debug)]
|
||||
pub enum Commands {
|
||||
/// minecraft management
|
||||
Minecraft(minecraft::MinecraftCommand),
|
||||
}
|
||||
Reference in New Issue
Block a user