Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Missing "--" in the "age" function



$ touch ./-s
$ autoload age
$ ls -ld -- *(e:age today:)
age:zstat:39: no files given
zsh: no matches found: *(e:age today:)

See patch below.

Also, the business about $1/$2 (not $AGEREF/$AGEREF2!) starting
with ":" to mean take the date (not time!) from reference files
seems not to be documented.

Cheers,
Stephane


--- /usr/share/zsh/functions/Calendar/age.back  2013-05-21 12:39:17.702739313 +0100
+++ /usr/share/zsh/functions/Calendar/age       2013-05-21 12:46:52.315052879 +0100
@@ -36,18 +36,18 @@
 local -a vals tmp

 [[ -e $REPLY ]] || return 1
-zstat -A vals +mtime $REPLY || return 1
+zstat -A vals +mtime -- $REPLY || return 1

 if (( $# >= 1 )); then
   if [[ $1 = :* ]]; then
-    zstat -A tmp -F "%Y/%m/%d" +mtime ${1[2,-1]} || return 1
+    zstat -A tmp -F "%Y/%m/%d" +mtime -- ${1#:} || return 1
     local AGEREF=$tmp[1]
   else
     local AGEREF=$1
   fi
   # if 1 argument given, never use globally defined AGEREF2
   if [[ $2 = :* ]]; then
-    zstat -A tmp -F "%Y/%m/%d" +mtime ${2[2,-1]} || return 1
+    zstat -A tmp -F "%Y/%m/%d" +mtime -- ${2#:} || return 1
     local AGEREF2=$tmp[1]
   else
     local AGEREF2=$2



Messages sorted by: Reverse Date, Date, Thread, Author