diff options
Diffstat (limited to 'pim/rc/agenda')
| -rwxr-xr-x | pim/rc/agenda | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pim/rc/agenda b/pim/rc/agenda index ec38ad2..563758f 100755 --- a/pim/rc/agenda +++ b/pim/rc/agenda @@ -6,6 +6,7 @@ mtpt=/mnt/pim days=7 off=0 only=() +start=() while(~ $1 -*){ switch($1){ @@ -15,10 +16,18 @@ while(~ $1 -*){ days=$2; shift case -o off=$2; shift + case -d + # seconds(1) parses a human date; date(1) only formats one + start=`{seconds $2} + if(~ $#start 0){ + echo 'pim/agenda: cannot read the date '^$2 >[1=2] + exit baddate + } + shift case -c only=($only $2); shift case * - echo 'usage: agenda [-m mtpt] [-n days] [-o dayoffset] [-c cal]' >[1=2] + echo 'usage: agenda [-m mtpt] [-n days] [-d date] [-o dayoffset] [-c cal]' >[1=2] exit usage } shift @@ -39,7 +48,9 @@ if(! ~ $#cals 1) tmp=/tmp/agenda.$pid fn sigexit { rm -f $tmp } -now=`{date -n} +now=$start +if(~ $#now 0) + now=`{date -n} i=$off last=`{echo $off + $days | bc} n=0 |
