]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/CLI.pm
Added parse_args to Maypole::CLI and CGI::Maypole
[maypole.git] / lib / Maypole / CLI.pm
index 8b7107b7b164a33a421cff6963896fb98dacc35f..9f65c7c0b747c66c3e8612b2dd0b2011ee2fd93a 100644 (file)
@@ -1,6 +1,7 @@
 package Maypole::CLI;
 use UNIVERSAL::require;
 use URI; use URI::QueryParam;
+use Maypole::Constants;
 
 use strict;
 use warnings;
@@ -24,6 +25,12 @@ sub parse_location {
     $self->{path} = $url->path;
     $self->{path} =~ s/^$root//i if $root;
     $self->parse_path;
+    $self->parse_args;
+}
+
+sub parse_args {
+    my $self = shift;
+    $self->{params} = $url->query_form_hash;
     $self->{query} = $url->query_form_hash;
 }
 
@@ -31,7 +38,7 @@ sub send_output { $buffer = shift->{output} }
 
 # Do it!
 CHECK { if ((caller(0))[1] eq "-e") { 
-            $package->handler() and print $buffer; 
+            $package->handler() == OK and print $buffer; 
        } }
 
 1;