diff options
author | Daniel Friesel <derf@finalrewind.org> | 2010-12-17 19:59:36 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2010-12-17 19:59:36 +0100 |
commit | 8db494f2b4b077759fe4a651fc3ac5096e03321a (patch) | |
tree | 6e528d61b3850cddb72a3086fa5bc71b40f61e24 /bin | |
parent | b5124f2d4b990d1f1a1682d3825d5285bb912c42 (diff) |
vzds: Add -t (negative display start offset)
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/vzds | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -13,7 +13,7 @@ use Term::ANSIColor; my %opts; -getopts('a:cg', \%opts); +getopts('a:cgt:', \%opts); my $count = shift // 5; @@ -38,12 +38,15 @@ my $yellow = $im->colorAllocateAlpha(255, 255, 200, $alpha); my $red = $im->colorAllocateAlpha(255, 191, 191, $alpha); my $text; +my $start = time(); -getopts('cg', \%opts); +if ($opts{'t'}) { + $start -= $opts{'t'} * (3600 * 24 * 7); +} for my $i (1 .. $count) { - my @time = localtime(time + (3600 * 24 * $i)); + my @time = localtime($start + (3600 * 24 * $i)); my $day = strftime('%a', @time); my $mday = strftime('%d', @time); my $date = strftime('%m/%d', @time); |