diff options
Diffstat (limited to 'pim/rc/show')
| -rwxr-xr-x | pim/rc/show | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/pim/rc/show b/pim/rc/show index da23973..b22ca82 100755 --- a/pim/rc/show +++ b/pim/rc/show @@ -9,6 +9,7 @@ mtpt=/mnt/pim days=90 all=() only=() +start=() while(~ $1 -*){ switch($1){ @@ -20,14 +21,21 @@ while(~ $1 -*){ all=1 case -c only=($only $2); shift + case -d + start=`{seconds $2} + if(~ $#start 0){ + echo 'pim/show: cannot read the date '^$2 >[1=2] + exit baddate + } + shift case * - echo 'usage: show [-m mtpt] [-n days] [-c cal] [-a] path|pattern' >[1=2] + echo 'usage: show [-m mtpt] [-n days] [-d date] [-c cal] [-a] path|pattern' >[1=2] exit usage } shift } if(~ $#* 0){ - echo 'usage: show [-m mtpt] [-n days] [-c cal] [-a] path|pattern' >[1=2] + echo 'usage: show [-m mtpt] [-n days] [-d date] [-c cal] [-a] path|pattern' >[1=2] exit usage } pat=$"* @@ -76,7 +84,9 @@ fn search { cals=$only if(~ $#cals 0) cals=`{pim/calendars -m $mtpt} - now=`{date -n} + now=$start + if(~ $#now 0) + now=`{date -n} i=0 while(test $i -lt $days){ sec=`{echo $now + $i '*' 86400 | bc} |
