Set up a client and basic command infrastructure

This commit is contained in:
Marc Plano-Lesay 2024-10-24 11:55:16 +11:00
parent 56a22203ef
commit 46338adca4
6 changed files with 278 additions and 1 deletions

29
src/args.rs Normal file
View file

@ -0,0 +1,29 @@
use clap::{command, Parser, Subcommand};
#[derive(Parser)]
#[command(version, about, long_about = None)]
pub(crate) struct Opts {
#[arg(short, long)]
pub server_url: String,
#[arg(short, long)]
pub api_key: String,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub(crate) enum Commands {
/// Server related commands
Server {
#[command(subcommand)]
server_command: ServerCommands,
},
}
#[derive(Subcommand)]
pub(crate) enum ServerCommands {
/// Fetches the version of the server
Version {},
}