Add r-flag to touch(1), refactor manpage and code

and mark it as finished in README.
This commit is contained in:
FRIGN
2015-02-09 00:41:57 +01:00
parent 49ed53b46c
commit d6b3890af6
3 changed files with 46 additions and 16 deletions

50
touch.1
View File

@@ -1,4 +1,4 @@
.Dd January 20, 2014
.Dd February 9, 2014
.Dt TOUCH 1
.Os sbase
.Sh NAME
@@ -7,25 +7,47 @@
.Sh SYNOPSIS
.Nm
.Op Fl acm
.Op Fl t Ar stamp
.Op Fl r Ar ref_file | t Ar timestamp
.Ar file ...
.Sh DESCRIPTION
.Nm
sets the access and modification times of files to the current time of day. If
the file doesn't exist, it is created with the default permissions.
sets the access or modification time of each
.Ar file
to the current time of day. If
.Ar file
doesn't exist, it is created with default permissions.
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl a
Set the access time of the file.
.It Fl a | Fl m
Set the access | modification time of
.Ar file.
.It Fl c
Do not create the file it it does not exist. The exit status is not affected.
.It Fl m
Change the modification time of the file.
.It Fl t Ar stamp
Set the timestamp to be used with
.Op Fl am .
The format of the timestamp is simply the number of seconds since Jan 1, 1970.
This specification of time does not conform to POSIX.
Don't create
.Ar file
if it doesn't exist, not affecting exit status.
.It Fl r Ar ref_file
Set the timestamp
to be used with
.Op Fl am
to the modification time of
.Ar ref_file .
.It Fl t Ar timestamp
Set the
.Ar timestamp
to be used with
.Op Fl am
given as the number of seconds since the
Unix epoch 1970-01-01T00:00:00Z.
.El
.Sh SEE ALSO
.Xr date 1
.Sh STANDARDS
The
.Nm
utility is compliant with the
.St -p1003.1-2008
specification except from the
.Ar timestamp
format of the
.Fl t
flag.