summary refs log tree commit diff
path: root/lib/Net/HTTP/Console/Dispatcher/Help.pm
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-06-08 18:01:03 +0200
committerfranck cuny <franck@lumberjaph.net>2010-06-08 18:01:03 +0200
commitd0958fca7e5b21131857f40c1aac60a59893ed63 (patch)
tree9d05f271ba956b366298b2739321884775130542 /lib/Net/HTTP/Console/Dispatcher/Help.pm
parentrole to log and write (diff)
downloadnet-http-console-d0958fca7e5b21131857f40c1aac60a59893ed63.tar.gz
fix loading lib; rename print to message
Diffstat (limited to '')
-rw-r--r--lib/Net/HTTP/Console/Dispatcher/Help.pm58
1 files changed, 29 insertions, 29 deletions
diff --git a/lib/Net/HTTP/Console/Dispatcher/Help.pm b/lib/Net/HTTP/Console/Dispatcher/Help.pm
index 6218676..3868d73 100644
--- a/lib/Net/HTTP/Console/Dispatcher/Help.pm
+++ b/lib/Net/HTTP/Console/Dispatcher/Help.pm
@@ -4,6 +4,10 @@ use MooseX::Declare;
 
 class Net::HTTP::Console::Dispatcher::Help with Net::HTTP::Console::Dispatcher {
 
+    method pattern($input) {
+        $input =~ /^help/ ? return $input : return 0;
+    }
+
     method dispatch($input) {
         (my $cmd, my $cmd_name) = $input =~ /^help\s(\w+)?\s?(\w+)?/;
 
@@ -29,10 +33,6 @@ class Net::HTTP::Console::Dispatcher::Help with Net::HTTP::Console::Dispatcher {
         1;
     }
 
-    method pattern($input) {
-        $input =~ /^help/ ? return $input : return 0;
-    }
-
     method _display_help {
         print <<EOF
 help command    -  help about a command
@@ -43,31 +43,6 @@ help load       -  help on how to load a lib
 EOF
     }
 
-    method _list_commands {
-        my @methods =
-          $self->application->api_object->meta->get_all_net_api_methods();
-
-        if (!@methods) {
-            print "no method available\n";
-            return;
-        }
-
-        print "available commands:\n";
-        map { print "- " . $_ . "\n" } @methods;
-    }
-
-    method _get_help_for_command($cmd_name) {
-        my $method =
-          $self->application->api_object->meta->find_net_api_method_by_name($cmd_name);
-
-        if (!$method) {
-            print "unknown method " . $cmd_name . "\n";
-            return;
-        }
-
-        print $method->documentation;
-    }
-
     method _help_about_view {
         print <<EOF
 view headers         -  show the headers of the last request
@@ -93,6 +68,31 @@ EOF
 load libname    -  load a MooseX::Net::API library
 EOF
     }
+
+    method _list_commands {
+        my @methods =
+          $self->application->api_object->meta->get_all_net_api_methods();
+
+        if (!@methods) {
+            print "no method available\n";
+            return;
+        }
+
+        print "available commands:\n";
+        map { print "- " . $_ . "\n" } @methods;
+    }
+
+    method _get_help_for_command($cmd_name) {
+        my $method =
+          $self->application->api_object->meta->find_net_api_method_by_name($cmd_name);
+
+        if (!$method) {
+            print "unknown method " . $cmd_name . "\n";
+            return;
+        }
+
+        print $method->documentation;
+    }
 }
 
 1;