mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-27 04:40:59 +01:00
31418: improve documentation for "age" function
This commit is contained in:
parent
06e17f8112
commit
692a15363f
3 changed files with 15 additions and 3 deletions
|
|
@ -1,5 +1,9 @@
|
||||||
2013-05-21 Peter Stephenson <p.stephenson@samsung.com>
|
2013-05-21 Peter Stephenson <p.stephenson@samsung.com>
|
||||||
|
|
||||||
|
* 31418: Doc/Zsh/calsys.yo, Functions/Calendar/age:
|
||||||
|
in "age" docs correct typo and note the feature that
|
||||||
|
you can supply a file as a timestamp on the command line.
|
||||||
|
|
||||||
* Stephane: 31417: Functions/Calendar/age: needs --
|
* Stephane: 31417: Functions/Calendar/age: needs --
|
||||||
to protect againts files starting with -.
|
to protect againts files starting with -.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -651,16 +651,24 @@ date specification must be quoted to ensure tt(age) receives the correct
|
||||||
arguments, hence the use of the additional colon to separate the date and
|
arguments, hence the use of the additional colon to separate the date and
|
||||||
time.
|
time.
|
||||||
|
|
||||||
example(AGEREF1=2006/10/04:10:15
|
example(AGEREF=2006/10/04:10:15
|
||||||
AGEREF2=2006/10/04:10:45
|
AGEREF2=2006/10/04:10:45
|
||||||
print *+LPAR()PLUS()age+RPAR())
|
print *+LPAR()PLUS()age+RPAR())
|
||||||
|
|
||||||
This shows the same example before using another form of argument
|
This shows the same example before using another form of argument
|
||||||
passing. The dates and times in the parameters tt(AGEREF1) and tt(AGEREF2)
|
passing. The dates and times in the parameters tt(AGEREF) and tt(AGEREF2)
|
||||||
stay in effect until unset, but will be overridden if any argument is
|
stay in effect until unset, but will be overridden if any argument is
|
||||||
passed as an explicit argument to age. Any explicit argument
|
passed as an explicit argument to age. Any explicit argument
|
||||||
causes both parameters to be ignored.
|
causes both parameters to be ignored.
|
||||||
|
|
||||||
|
Instead of an explicit date and time, it's possible to use the
|
||||||
|
modification time of a file as the date and time for either argument
|
||||||
|
by introducing the file name with a colon:
|
||||||
|
|
||||||
|
example(print *+LPAR()e-age :file1 :file2-+RPAR())
|
||||||
|
|
||||||
|
This matches all files modified no earlier than tt(file1) and
|
||||||
|
no later than tt(file2).
|
||||||
|
|
||||||
texinode(Calendar Styles)(Calendar Utility Functions)(Calendar System User Functions)(Calendar Function System)
|
texinode(Calendar Styles)(Calendar Utility Functions)(Calendar System User Functions)(Calendar Function System)
|
||||||
sect(Styles)
|
sect(Styles)
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
# are allowed, but whitespace must be quoted to ensure age receives
|
# are allowed, but whitespace must be quoted to ensure age receives
|
||||||
# the correct arguments.
|
# the correct arguments.
|
||||||
#
|
#
|
||||||
# AGEREF1=2006/10/04:10:15
|
# AGEREF=2006/10/04:10:15
|
||||||
# AGEREF2=2006/10/04:10:45
|
# AGEREF2=2006/10/04:10:45
|
||||||
# print *(+age)
|
# print *(+age)
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue