From 4a30b695620793f997ed03742e1e34b5e8bd14f7 Mon Sep 17 00:00:00 2001 From: Heather Date: Sun, 9 Feb 2014 15:00:41 +0400 Subject: [PATCH 1/2] du --version was not implemented --- du/du.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/du/du.rs b/du/du.rs index e0e2e9c11..1cd086a2a 100644 --- a/du/du.rs +++ b/du/du.rs @@ -170,6 +170,9 @@ SIZE is an integer and optional unit (example: 10M is 10*1024*1024). Units are K, M, G, T, P, E, Z, Y (powers of 1024) or KB, MB, ... (pow‐ ers of 1000)."); return + } else if matches.opt_present("version") { + println!("du version: {}", VERSION); + return } let options = Options{ From 52f17ef22749ebde979f4602ffe2dc2da465ad28 Mon Sep 17 00:00:00 2001 From: Heather Date: Mon, 10 Feb 2014 08:56:13 +0400 Subject: [PATCH 2/2] du: add -V and -h --- du/du.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/du/du.rs b/du/du.rs index 1cd086a2a..bb8e8ac02 100644 --- a/du/du.rs +++ b/du/du.rs @@ -141,8 +141,8 @@ fn main() { // In main getopts::optopt("", "time-style", "show times using style STYLE: full-iso, long-iso, iso, +FORMAT FORMAT is interpreted like 'date'", "STYLE"), - getopts::optflag("", "help", "display this help and exit"), - getopts::optflag("", "version", "output version information and exit"), + getopts::optflag("h", "help", "display this help and exit"), + getopts::optflag("V", "version", "output version information and exit"), ]; let matches = match getopts::getopts(args.tail(), opts) {