diff options
| author | Denis Evsyukov <[email protected]> | 2020-03-07 18:57:10 +0300 |
|---|---|---|
| committer | Denis Evsyukov <[email protected]> | 2020-03-07 18:57:10 +0300 |
| commit | 6a4acffd73eb51fcdaca701304482f9fe95b3612 (patch) | |
| tree | c8bb3c5b024fdacf198438414e09398468f68d0d | |
| parent | [+] getopts (diff) | |
| download | t-6a4acffd73eb51fcdaca701304482f9fe95b3612.tar.xz t-6a4acffd73eb51fcdaca701304482f9fe95b3612.zip | |
[+] help
| -rw-r--r-- | src/main.rs | 13 |
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); } |