1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-03-06 13:05:04 +02:00

(main): Issue a warning for obsolete usage, unless POSIXLY_CORRECT.

This commit is contained in:
Jim Meyering
2002-01-18 15:36:23 +00:00
parent 96400fcda4
commit 1f2f9be7f8

View File

@@ -364,6 +364,16 @@ main (int argc, char **argv)
newtime = posixtime (argv[optind], PDS_TRAILING_YEAR);
if (newtime != (time_t) -1)
{
if (! getenv ("POSIXLY_CORRECT"))
{
struct tm const *tm = posixtm (argv[optind], PDS_TRAILING_YEAR);
error (0, 0,
_("warning: `touch %s' is obsolete; use `touch -t %04d%02d%02d%02d%02d.%02d'"),
argv[optind],
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
}
optind++;
date_set++;
}