Parse cli args

This commit is contained in:
Joscha 2023-07-30 15:54:35 +02:00
parent 5e04129f4d
commit b29f22a5a8
3 changed files with 951 additions and 2 deletions

View file

@ -1,3 +1,26 @@
fn main() {
println!("Hello, world!");
use std::path::PathBuf;
use clap::Parser;
#[derive(Debug, clap::Parser)]
struct BwCmd {}
#[derive(Debug, clap::Parser)]
enum Cmd {
Bw(BwCmd),
}
#[derive(Debug, clap::Parser)]
struct Args {
#[arg(long, short)]
r#in: Option<PathBuf>,
#[arg(long, short)]
out: Option<PathBuf>,
#[command(subcommand)]
cmd: Cmd,
}
fn main() {
let args = Args::parse();
println!("{args:#?}");
}