journal_sdk/
config.rs

1use clap::Parser;
2
3#[derive(Parser, Debug)]
4#[command(author, version, about = "Deploy a Synchronic Web Journal Software Development Kit (SDK) as a local webserver")]
5pub struct Config {
6    #[arg(short, long, default_value_t = String::from(""), help = "Path to the persistent database")]
7    pub database: String,
8
9    #[arg(short, long, default_value_t = 4096, help = "Port to access the webserver")]
10    pub port: u16,
11
12    #[arg(short, long, default_value_t = String::from(""), help = "Initial script to pass into the Journal")]
13    pub boot: String,
14
15    #[arg(short, long, default_value_t = String::from(""), help = "If set, then evaluate the provided query, print, and exit immediately")]
16    pub evaluate: String,
17
18    #[arg(short, long, default_value_t = String::from(""), help = "Contents of the step query")]
19    pub step: String,
20
21    #[arg(short = 'c', long, default_value_t = 0, help = "Power of two determining the period of the step query")]
22    pub periodicity: i32,
23}
24
25impl Config {
26    pub fn new() -> Self {
27        Config::parse()
28    }
29}