[Rt-devel] [patch]: make command-line tool safe to be invoked with IO redirection

Jesse Vincent jesse at bestpractical.com
Mon Sep 1 19:33:44 EDT 2008

On Aug 25, 2008, at 9:57 AM, Otmar Lendl wrote:

> On 2008/08/25 14:08, Jesse Vincent <jesse at bestpractical.com> wrote:
>> Depending on /dev/tty feels like it's going to break on some common
>> platform or other.  Anyone have any useful guidance?
> The only other option I see is to add a command-line option to give a
> filename into which the response from the server gets written.
> That doesn't win an prize for elegance, though.
> Another question for the command-line tool:
> If the server returns an error, the user is dumped into the editor.
> What is the user supposed to do if he wants to abort the operation?
> Clear the file? ^C doesn't work as that affects the editor and not
> the script.

That certainly sounds like it could use improvement. I think I've  
always "quit the editor and hit control C"

But really, the editor-running bit should be able to sense if you  
haven't changed the file.

I'd love a patch. Possibly something which optionally uses  
Proc::InvokeEditor if it's installed or cargo-cults the logic from lib/ 
SVK/Util.pm (in the svk codebase, which happens to be something I have  
with me on the plane ;)
> /ol
> -- 
> -=-  Otmar Lendl  --  ol at bofh.priv.at  -=-

More information about the Rt-devel mailing list