summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-06-23 14:49:05 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-06-23 14:49:05 (GMT)
commite4624ce9f82e49fff037088999c45e92f37208ec (patch)
tree720005d9d0385abdbe163d8e4cac8cfab781507d /utils
parent3eeabde070d9a5823f78b8d9b997a22e21653fb6 (diff)
added feature to export schedules list0.10.0rel-0.10.0
Diffstat (limited to 'utils')
-rwxr-xr-xutils/rhrd-schedules25
1 files changed, 24 insertions, 1 deletions
diff --git a/utils/rhrd-schedules b/utils/rhrd-schedules
index fbd8227..1bd3776 100755
--- a/utils/rhrd-schedules
+++ b/utils/rhrd-schedules
@@ -30,7 +30,7 @@ use DateTime::Format::Strptime;
sub print_usage
{
- print STDERR "Usage: rhrd-schedules generate YYYY-MM-DD\n" .
+ print STDERR "Usage: rhrd-schedules (generate|get) YYYY-MM-DD\n" .
" rhrd-schedules show (W1|W2|W3|W4|ALL) (MO|TU|WE|TH|FR|SA|SU|ALL)\n" .
" rhrd-schedules orphans\n";
}
@@ -90,6 +90,22 @@ sub generate
return $errcnt;
}
+sub get
+{
+ my ($ctx, $year, $month, $day) = @_;
+
+ my @shows = RHRD::rddb::get_schedule_log($ctx, $year, $month, $day);
+ if(!defined $shows[0] && defined $shows[1]) {
+ print STDERR "$shows[1]: $shows[2]\n";
+ return 1;
+ }
+ for my $href (@shows) {
+ print $href->{'START'} . ": " . $href->{'ID'} . " | " . $href->{'TITLE'} . " (" . $href->{'LEN'} . " ms)\n";
+ }
+
+ return 0;
+}
+
sub show__day
{
my ($ctx, $year, $month, $day) = @_;
@@ -327,6 +343,13 @@ if(defined $ctx) {
print_usage();
$ret = 1;
}
+ } if($cmd eq "get") {
+ if($num_args == 2 && $ARGV[1] =~ m/^(\d{4})-(\d{2})-(\d{2})$/) {
+ $ret = get($ctx, $1, $2, $3);
+ } else {
+ print_usage();
+ $ret = 1;
+ }
} elsif($cmd eq "show") {
if($num_args != 3) {
print_usage();