[Rt-commit] r4785 - in rt/branches/3.5-TESTING: . lib/t/regression

kevinr at bestpractical.com kevinr at bestpractical.com
Mon Mar 20 21:18:30 EST 2006


Author: kevinr
Date: Mon Mar 20 21:18:29 2006
New Revision: 4785

Modified:
   rt/branches/3.5-TESTING/   (props changed)
   rt/branches/3.5-TESTING/bin/rt.in
   rt/branches/3.5-TESTING/lib/t/regression/26command_line.t

Log:
 r11585 at sad-girl-in-snow:  kevinr | 2006-03-20 18:18:11 -0500
 * Fixed the RT command-line tool to not spew the entire help text for the 
 command you just typed if you screw something up, so you don't have to scroll
 up to see the actual error message.
 * Changed most of the todo_skip CLI tests to TODO tests, so I can see when they
 start passing, since I no longer have to wade through many many screens worth
 of help text. :)


Modified: rt/branches/3.5-TESTING/bin/rt.in
==============================================================================
--- rt/branches/3.5-TESTING/bin/rt.in	(original)
+++ rt/branches/3.5-TESTING/bin/rt.in	Mon Mar 20 21:18:29 2006
@@ -275,7 +275,8 @@
         whine "No $item specified.";
         $bad = 1;
     }
-    return help("list", $type) if $bad;
+    #return help("list", $type) if $bad;
+    return suggest_help("list", $type) if $bad;
 
     my $r = submit("$REST/search/$type", { query => $q, %data });
     print $r->content;
@@ -332,7 +333,8 @@
         whine "No objects specified.";
         $bad = 1;
     }
-    return help("show", $type) if $bad;
+    #return help("show", $type) if $bad;
+    return suggest_help("show", $type) if $bad;
 
     my $r = submit("$REST/show", { id => \@objects, %data });
     print $r->content;
@@ -439,7 +441,8 @@
         }
         @objects = ("$type/new");
     }
-    return help($action, $type) if $bad;
+    #return help($action, $type) if $bad;
+    return suggest_help($action, $type) if $bad;
 
     # We need a form to make changes to. We usually ask the server for
     # one, but we can avoid that if we are fed one on STDIN, or if the
@@ -606,7 +609,8 @@
         whine "No object specified.";
         $bad = 1;
     }
-    return help($action, "ticket") if $bad;
+    #return help($action, "ticket") if $bad;
+    return suggest_help($action, "ticket") if $bad;
 
     my $form = [
         "",
@@ -686,7 +690,8 @@
         whine "Too $evil arguments specified.";
         $bad = 1;
     }
-    return help("merge", "ticket") if $bad;
+    #return help("merge", "ticket") if $bad;
+    return suggest_help("merge", "ticket") if $bad;
 
     my $r = submit("$REST/ticket/merge/$id[0]", {into => $id[1]});
     print $r->content;
@@ -729,7 +734,8 @@
         whine "Too $bad arguments specified.";
         $bad = 1;
     }
-    return help("link", "ticket") if $bad;
+    #return help("link", "ticket") if $bad;
+    return suggest_help("link", "ticket") if $bad;
 
     my $r = submit("$REST/ticket/link", \%data);
     print $r->content;
@@ -1335,6 +1341,13 @@
     return;
 }
 
+sub suggest_help {
+    my ($action, $type) = @_;
+
+    print STDERR "rt: For help, run 'rt help $action'.\n" if defined $action;
+    print STDERR "rt: For help, run 'rt help $type'.\n" if defined $type;
+}
+
 __DATA__
 
 Title: intro

Modified: rt/branches/3.5-TESTING/lib/t/regression/26command_line.t
==============================================================================
--- rt/branches/3.5-TESTING/lib/t/regression/26command_line.t	(original)
+++ rt/branches/3.5-TESTING/lib/t/regression/26command_line.t	Mon Mar 20 21:18:29 2006
@@ -32,7 +32,8 @@
 #    - RTPASSWD
 $ENV{'RTPASSWD'} = 'password';
 #    - RTSERVER
-$ENV{'RTSERVER'} = "$RT::WebBaseURL";
+$RT::Logger->debug("Connecting to server at $RT::WebBaseURL...");
+$ENV{'RTSERVER'} = $RT::WebBaseURL;
 #    - RTDEBUG       Numeric debug level. (Set to 3 for full logs.)
 $ENV{'RTDEBUG'} = '3';
 #    - RTCONFIG      Specifies a name other than ".rtrc" for the
@@ -60,7 +61,7 @@
 
 # add a comment to ticket
 TODO: {
-    todo_skip "Adding comments/correspondence is broken right now", 8;
+    local $TODO = "Adding comments/correspondence is broken right now";
     expect_send(q{create -t ticket set subject='new ticket'}, "Creating a ticket as just a subject...");
     expect_like(qr/Ticket \d+ created/, "Created the ticket");
     expect_send("comment -m 'comment-$$' $ticket_id", "Adding a comment...");
@@ -142,7 +143,7 @@
 expect_send("show ticket/$ticket_id/history", 'Showing our ticket\'s history...');
 expect_like(qr/Ticket created by root/, 'Got our history');
 TODO: {
-    todo_skip "Cannot show verbose ticket history right now", 2;
+    local $TODO = "Cannot show verbose ticket history right now";
     # show ticket history verbosely
     expect_send("show -v ticket/$ticket_id/history", 'Showing our ticket\'s history verbosely...');
     expect_like(qr/Ticket created by root/, 'Got our history');
@@ -199,7 +200,7 @@
 expect_like(qr/id: group\/$group_id/, 'Saw the group');
 expect_like(qr/Name: EditedGroup$$/, 'Saw the modification');
 TODO: { 
-    todo_skip "Listing non-ticket items doesn't work", 2;
+    local $TODO = "Listing non-ticket items doesn't work";
     expect_send("list -t group 'id > 0'", 'Listing the groups...');
     expect_like(qr/$group_id: EditedGroup$$/, 'Found the group');
 }


More information about the Rt-commit mailing list