aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Evsyukov <[email protected]>2020-03-07 18:57:10 +0300
committerDenis Evsyukov <[email protected]>2020-03-07 18:57:10 +0300
commit6a4acffd73eb51fcdaca701304482f9fe95b3612 (patch)
treec8bb3c5b024fdacf198438414e09398468f68d0d
parent[+] getopts (diff)
downloadt-6a4acffd73eb51fcdaca701304482f9fe95b3612.tar.xz
t-6a4acffd73eb51fcdaca701304482f9fe95b3612.zip
[+] help
-rw-r--r--src/main.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 88027c7..283fa69 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -36,8 +36,17 @@ fn main() {
};
if matches.opt_present("h") {
- let brief = "t is for people that want do things, not organize their tasks";
- opts.usage(&brief);
+ let brief = "t is for people that want do things, not organize their tasks
+
+Usage: t [-t DIR] [-l LIST] [options] [TEXT]";
+ print!("{}", opts.usage(&brief));
return;
}
+
+ let input = if !matches.free.is_empty() {
+ matches.free[0].clone()
+ } else {
+ "Print tasks".to_string()
+ };
+ println!("{}", input);
}