initial commit

This commit is contained in:
postscriptum 2025-07-01 17:39:30 +03:00
commit 63f53528dc
10 changed files with 443 additions and 0 deletions

37
src/config.rs Normal file
View file

@ -0,0 +1,37 @@
use clap::Parser;
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct Config {
/// Path to the Snac2 profile directory
#[arg(short, long)]
pub source: String,
/// Target directory for public data export
#[arg(short, long)]
pub target: String,
/// Username to export
#[arg(short, long)]
pub user: Vec<String>,
/// Keep running as the daemon, renew every `n` seconds
#[arg(short, long)]
pub rotate: Option<u64>,
/// Post template pattern
#[arg(short, long, default_value_t = String::from("{content}{attachments}{link}{tags}{updated}"))]
pub format_content: String,
/// Post filenames format
///
/// * escaped with `%%`
#[arg(long, default_value_t = String::from("%H:%M:%S.txt"))]
pub format_filename: String,
/// Post `{updated}` time format
///
/// * escaped with `%%`
#[arg(long, default_value_t = String::from("%Y/%m/%d %H:%M:%S"))]
pub format_updated: String,
}