Add a command to synchronise date of births

This commit is contained in:
Marc Plano-Lesay 2024-10-28 14:46:31 +11:00
parent 5eb1e3bba4
commit bc09979a62
6 changed files with 392 additions and 5 deletions

View file

@ -1,3 +1,5 @@
use std::path::PathBuf;
use clap::{command, Parser, Subcommand};
#[derive(Parser)]
@ -9,12 +11,20 @@ pub(crate) struct Opts {
#[arg(short, long)]
pub api_key: String,
#[arg(short, long)]
pub dry_run: bool,
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub(crate) enum Commands {
/// People related commands
People {
#[command(subcommand)]
people_command: PeopleCommands,
},
/// Server related commands
Server {
#[command(subcommand)]
@ -22,6 +32,15 @@ pub(crate) enum Commands {
},
}
#[derive(Subcommand)]
pub(crate) enum PeopleCommands {
/// Synchronises date of births from a vcard file
SyncDateOfBirths {
#[arg(short, long)]
vcard_file: PathBuf,
},
}
#[derive(Subcommand)]
pub(crate) enum ServerCommands {
/// Fetches the version of the server