snac2nex/src/config.rs
2025-07-02 17:17:18 +03:00

47 lines
1.3 KiB
Rust

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(s) to export
#[arg(short, long)]
pub user: Vec<String>,
/// Include attachment files export
///
/// Supported values:
///
/// * `c` (`copy`) - copy files
/// * `h` (`hard`) - create hard links
/// * `s` (`soft`) - create soft links (macos, linux, windows only)
#[arg(short, long)]
pub attachment: Option<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"))]
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,
}