Parse command line args
This commit is contained in:
parent
6c0cb6489a
commit
04b59293f2
3 changed files with 202 additions and 2 deletions
15
src/main.rs
15
src/main.rs
|
|
@ -1,5 +1,16 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
use structopt::StructOpt;
|
||||
|
||||
mod commands;
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
#[derive(Debug, StructOpt)]
|
||||
pub struct Opt {
|
||||
#[structopt(parse(from_os_str))]
|
||||
file: PathBuf,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let opt = Opt::from_args();
|
||||
println!("{:#?}", opt);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue