Rust library to generate static websites
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: scaffold CLI

+102
+57
Cargo.lock
··· 354 354 ] 355 355 356 356 [[package]] 357 + name = "clap" 358 + version = "4.5.23" 359 + source = "registry+https://github.com/rust-lang/crates.io-index" 360 + checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" 361 + dependencies = [ 362 + "clap_builder", 363 + "clap_derive", 364 + ] 365 + 366 + [[package]] 367 + name = "clap_builder" 368 + version = "4.5.23" 369 + source = "registry+https://github.com/rust-lang/crates.io-index" 370 + checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" 371 + dependencies = [ 372 + "anstream", 373 + "anstyle", 374 + "clap_lex", 375 + "strsim", 376 + ] 377 + 378 + [[package]] 379 + name = "clap_derive" 380 + version = "4.5.18" 381 + source = "registry+https://github.com/rust-lang/crates.io-index" 382 + checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" 383 + dependencies = [ 384 + "heck", 385 + "proc-macro2", 386 + "quote", 387 + "syn 2.0.91", 388 + ] 389 + 390 + [[package]] 391 + name = "clap_lex" 392 + version = "0.7.4" 393 + source = "registry+https://github.com/rust-lang/crates.io-index" 394 + checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" 395 + 396 + [[package]] 357 397 name = "colorchoice" 358 398 version = "1.0.3" 359 399 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1216 1256 "rustc-hash", 1217 1257 "thiserror 2.0.9", 1218 1258 "tokio", 1259 + ] 1260 + 1261 + [[package]] 1262 + name = "maudit-cli" 1263 + version = "0.1.0" 1264 + dependencies = [ 1265 + "chrono", 1266 + "clap", 1267 + "colored", 1268 + "env_logger", 1269 + "log", 1219 1270 ] 1220 1271 1221 1272 [[package]] ··· 2796 2847 "oxc_sourcemap", 2797 2848 "rustc-hash", 2798 2849 ] 2850 + 2851 + [[package]] 2852 + name = "strsim" 2853 + version = "0.11.1" 2854 + source = "registry+https://github.com/rust-lang/crates.io-index" 2855 + checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 2799 2856 2800 2857 [[package]] 2801 2858 name = "sugar_path"
+13
crates/cli/Cargo.toml
··· 1 + [package] 2 + name = "maudit-cli" 3 + description = "CLI to operate on maudit projects." 4 + version = "0.1.0" 5 + license = "MIT" 6 + edition = "2021" 7 + 8 + [dependencies] 9 + log = { version = "0.4", features = ["kv"] } 10 + env_logger = "0.11.5" 11 + chrono = "0.4.39" 12 + colored = "2.2.0" 13 + clap = { version = "4.5.23", features = ["derive"] }
+32
crates/cli/src/main.rs
··· 1 + use clap::{Parser, Subcommand}; 2 + 3 + #[derive(Parser)] 4 + #[command(author, version, about, long_about = None)] 5 + #[command(propagate_version = true)] 6 + struct Cli { 7 + #[command(subcommand)] 8 + command: Commands, 9 + } 10 + 11 + #[derive(Subcommand)] 12 + enum Commands { 13 + /// Build the project 14 + Build, 15 + /// Run the project in development mode 16 + Dev, 17 + } 18 + 19 + fn main() { 20 + let cli = Cli::parse(); 21 + 22 + // You can check for the existence of subcommands, and if found use their 23 + // matches just as you would the top level cmd 24 + match &cli.command { 25 + Commands::Build {} => { 26 + println!("Building..."); 27 + } 28 + Commands::Dev {} => { 29 + println!("Running in development mode..."); 30 + } 31 + } 32 + }