Parse basic args
This commit is contained in:
parent
2837927e2d
commit
a82db1b204
3 changed files with 331 additions and 2 deletions
16
src/main.rs
16
src/main.rs
|
|
@ -1,3 +1,15 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use std::path::PathBuf;
|
||||
|
||||
use clap::Parser;
|
||||
|
||||
#[derive(Debug, Parser)]
|
||||
struct Args {
|
||||
/// Path to a git repository.
|
||||
#[arg(default_value = ".")]
|
||||
repo: PathBuf,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let args = Args::parse();
|
||||
println!("Args: {args:#?}");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue