feat: Add clap and parse script parameter

This commit is contained in:
Laurens Miers 2025-05-27 17:43:47 +02:00
parent fce9dcc6fe
commit da82ece1ca
3 changed files with 258 additions and 3 deletions

View file

@ -1,3 +1,20 @@
fn main() {
println!("Hello, world!");
use clap::Parser;
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
struct Args {
/// Script to run
#[arg(short, long)]
script: Option<String>,
}
fn main() {
let args = Args::parse();
if let Some(script) = args.script {
println!("Run script! {}", script);
} else {
println!("Run Prompt");
}
}