A better Rust ATProto crate
at main 35 lines 1.0 kB view raw
1use clap::Parser; 2use std::path::PathBuf; 3 4#[derive(Parser, Debug)] 5#[command(author, version, about = "Fetch Lexicon schemas from various sources")] 6pub struct LexFetchArgs { 7 /// Path to KDL config file 8 #[arg(short = 'c', long, default_value = "lexicons.kdl")] 9 pub config: PathBuf, 10 11 /// Skip code generation step 12 #[arg(long)] 13 pub no_codegen: bool, 14 15 /// Verbose output 16 #[arg(short = 'v', long)] 17 pub verbose: bool, 18} 19 20#[derive(Parser, Debug)] 21#[command(author, version, about = "Generate Rust code from Lexicon schemas")] 22pub struct CodegenArgs { 23 /// Directory containing Lexicon JSON files 24 #[arg(short = 'i', long)] 25 pub input: PathBuf, 26 27 /// Output directory for generated Rust code 28 #[arg(short = 'o', long)] 29 pub output: PathBuf, 30 31 // TODO: root_module causes issues when set to anything other than "crate", needs rework 32 // /// Root module name (default: "crate") 33 // #[arg(short = 'r', long, default_value = "crate")] 34 // pub root_module: String, 35}