From e145f1c89677145048ee78cc47ef83a90f80b69d Mon Sep 17 00:00:00 2001 From: fukachan Date: Fri, 16 Feb 2001 11:49:07 +0000 Subject: add $command default value, diagnostic check more --- fml/lib/FML/Process/TicketSystem.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'fml/lib/FML/Process/TicketSystem.pm') diff --git a/fml/lib/FML/Process/TicketSystem.pm b/fml/lib/FML/Process/TicketSystem.pm index cd298989..4b4130d9 100644 --- a/fml/lib/FML/Process/TicketSystem.pm +++ b/fml/lib/FML/Process/TicketSystem.pm @@ -44,7 +44,7 @@ sub run my $model = $config->{ ticket_model }; my $pkg = "FML::Ticket::Model::". $model; my $argv = $args->{ ARGV }; - my $command = $argv->[ 0 ]; + my $command = $argv->[ 0 ] || 'list'; # fake use() to do "use FML::Ticket::$model;" eval qq{ require $pkg; $pkg->import();}; @@ -62,7 +62,12 @@ sub run ticket_id => $ticket_id, status => 'close', }; - $ticket->set_status($curproc, $args); + if ($ticket_id) { + $ticket->set_status($curproc, $args); + } + else { + croak("specify \$ticket_id"); + } $curproc->unlock(); } -- cgit v1.2.1