Add a command to synchronise date of births
This commit is contained in:
parent
5eb1e3bba4
commit
bc09979a62
6 changed files with 392 additions and 5 deletions
10
src/main.rs
10
src/main.rs
|
@ -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,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue