aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOndřej Čertík <ondrej@certik.us>2020-01-11 22:13:26 +0000
committerOndřej Čertík <ondrej@certik.us>2020-01-11 22:13:26 +0000
commite4881118047be41a27e15ce98a18141eac028809 (patch)
treec86a54a648a286f691dcb1e1ee76e50634760899 /src
parent910072d4875f4b0bb57e547990cf26c541460fcc (diff)
parentd7d33b6a00908271cc3f6d2fccd8f6bcf30154da (diff)
downloadfpm-e4881118047be41a27e15ce98a18141eac028809.tar.gz
fpm-e4881118047be41a27e15ce98a18141eac028809.zip
Merge branch 'args' into 'master'
Parse command line arguments See merge request certik/fpm!2
Diffstat (limited to 'src')
-rw-r--r--src/main.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index e7a11a9..4277e8c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,3 +1,15 @@
+use structopt::StructOpt;
+
+#[derive(Debug, StructOpt)]
+struct Cli {
+ /// The pattern to look for
+ pattern: String,
+ /// The path to the file to read
+ #[structopt(parse(from_os_str))]
+ path: std::path::PathBuf,
+}
+
fn main() {
- println!("Hello, world!");
+ let args = Cli::from_args();
+ println!("{:?}", args);
}