Ignore:
Timestamp:
11/25/10 03:34:05 (14 years ago)
Author:
nanardon
Message:
  • propery call fetchdata

command line parsing is done by the Model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/trunk/web/lib/Sophie/Model/Chat.pm

    r35 r36  
    22use Moose; 
    33use namespace::autoclean; 
     4use Getopt::Long; 
     5use Text::ParseWords; 
    46 
    57extends 'Catalyst::Model'; 
     
    3133    }, 
    3234    t => { 
    33         code => sub { $_[0]->forward('/distrib/list') }, 
     35        code => sub {  
     36            my ($c, $context, @args) = @_; 
     37            local @ARGV = @args; 
     38            join(', ', @{ $_[0]->forward('/distrib/list', [ {  
     39                distribution => $args[0], 
     40                release => $args[1], 
     41                arch => $args[2], 
     42                }, ] 
     43            ) });; 
     44        }, 
    3445    }, 
    3546}; 
    3647 
    3748sub process { 
    38     my ( $self, $c, $context, $cmd, @args) = @_; 
     49    my ( $self, $c, $context, $message) = @_; 
    3950 
    40     warn keys %$context; 
     51    my ($cmd, @args) = Text::ParseWords::shellwords($message); 
    4152 
    4253    my $msg; 
Note: See TracChangeset for help on using the changeset viewer.