mirror of
https://codeberg.org/postscriptum/snac2nex.git
synced 2026-03-31 21:25:28 +00:00
55 lines
1.5 KiB
Rust
55 lines
1.5 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,
|
|
|
|
/// Keep Nex entry on Snac post was removed
|
|
#[arg(short, long, default_value_t = false)]
|
|
pub keep: bool,
|
|
|
|
/// Disables some debug output
|
|
#[arg(short, long, default_value_t = false)]
|
|
pub daemon: bool,
|
|
}
|