From 38dd8aa657d80232d8bbce4ed359af2022f605c7 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sat, 18 Jul 2009 04:49:20 +0200 Subject: touch: implement -t TIME (needed for testsuite) This changes date -d TIME format a bit, makes it more compatible function old new delta parse_datestr 391 618 +227 touch_main 360 361 +1 packed_usage 26624 26615 -9 Signed-off-by: Denys Vlasenko --- coreutils/touch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'coreutils/touch.c') diff --git a/coreutils/touch.c b/coreutils/touch.c index 1b4a5f0ea..e79092fc1 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c @@ -64,10 +64,14 @@ int touch_main(int argc UNUSED_PARAM, char **argv) #if ENABLE_DESKTOP && ENABLE_LONG_OPTS applet_long_options = touch_longopts; #endif - opts = getopt32(argv, "c" IF_DESKTOP("r:d:") + /* -d and -t both set time. In coreutils, + * accepted data format differs a bit between -d and -t. + * We accept the same formats for both */ + opts = getopt32(argv, "c" IF_DESKTOP("r:d:t:") /*ignored:*/ "fma" IF_DESKTOP(, &reference_file) IF_DESKTOP(, &date_str) + IF_DESKTOP(, &date_str) ); opts &= 1; /* only -c bit is left */ -- cgit v1.2.3