Set up a client and basic command infrastructure
This commit is contained in:
parent
56a22203ef
commit
46338adca4
6 changed files with 278 additions and 1 deletions
29
src/args.rs
Normal file
29
src/args.rs
Normal 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 {},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue