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

@ -2,9 +2,10 @@ include!(concat!(env!("OUT_DIR"), "/codegen.rs"));
use crate::args::Commands;
use anyhow::Result;
use args::ServerCommands;
use args::{PeopleCommands, ServerCommands};
use clap::Parser;
use commands::server_version::server_version;
use commands::sync_date_of_birth::sync_date_of_birth;
use reqwest::header;
mod args;
@ -12,11 +13,18 @@ mod commands;
#[tokio::main]
async fn main() {
pretty_env_logger::init();
let args = args::Opts::parse();
let client = get_client(&args.server_url, &args.api_key).unwrap();
let res = match &args.command {
Commands::People { people_command } => match people_command {
PeopleCommands::SyncDateOfBirths { vcard_file } => {
sync_date_of_birth(&client, vcard_file, args.dry_run).await
}
},
Commands::Server { server_command } => match server_command {
ServerCommands::Version {} => server_version(&client).await,
},