[Rt-commit] r5084 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Tue Apr 25 08:26:16 EDT 2006
Author: ruz
Date: Tue Apr 25 08:26:15 2006
New Revision: 5084
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/bin/rt.in
Log:
r2162 at cubic-pc (orig r4739): kevinr | 2006-03-14 00:51:18 +0300
r11363 at SAD-GIRL-IN-SNOW: kevinr | 2006-03-06 23:33:15 -0500
* Added basic Term::ReadLine support to the CLI
Modified: rt/branches/3.7-EXPERIMENTAL/bin/rt.in
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/bin/rt.in (original)
+++ rt/branches/3.7-EXPERIMENTAL/bin/rt.in Tue Apr 25 08:26:15 2006
@@ -57,6 +57,7 @@
use LWP;
use Text::ParseWords;
use HTTP::Request::Common;
+use Term::ReadLine;
# We derive configuration information from hardwired defaults, dotfiles,
# and the RT* environment variables (in increasing order of precedence).
@@ -81,6 +82,10 @@
my $session = new Session("$HOME/.rt_sessions");
my $REST = "$config{server}/REST/1.0";
+my $term = new Term::ReadLine 'RT CLI';
+my $prompt = 'rt> ';
+my $TERM_OUT = $term->OUT || \*STDOUT;
+
sub whine;
sub DEBUG { warn @_ if $config{debug} >= shift }
@@ -144,16 +149,12 @@
sub shell {
$|=1;
- print "rt> ";
- while (<>) {
- chomp;
+ while ( defined ($_ = $term->readline($prompt)) ) {
next if /^#/ || /^\s*$/;
@ARGV = shellwords($_);
handler();
- print "rt> ";
}
- print "\n";
}
sub version {
More information about the Rt-commit
mailing list