Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Missing "--" in the "age" function
- X-seq: zsh-workers 31417
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Missing "--" in the "age" function
- Date: Tue, 21 May 2013 12:53:32 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; bh=CWUUkPsUqp4qq7j3hrnUSIqTKECPEpW+sd7T/CvhtMM=; b=GV85v8V6oN0cAvDhkmPVJYzIoBbyiGYy+rByZxOKhsNCaJD9PU8o/ZR6UmuIH/7nUN V4hS2BsJFPyZdHEe2y6p3MB+ZZxorXNRsXYyrCuaitRXq34q/wSh4OlvDAZwLanpUT2s dWm2S08LJA0sJTe3Ut00+3iwkKyP+guRpELwoPlykA1NOOw+5QBL9KIH6uTzsoVcg2Ss ECncBccKBFl29hAZBOq0lfGMvkq8DBMsrV+eltNmcALXnCNCNF62/WWRVvsYiyAvEol1 RlsxfX/aeF0eFnincmIIT9x2xMrbn3ildN0SSZlxBdai/w1NeI1eV7JOX8LbfSQgdPYd BjUg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
$ 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