Changeset 152


Ignore:
Timestamp:
10/16/02 01:57:07 (21 years ago)
Author:
piso
Message:

Work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/CommandInterpreter.java

    r149 r152  
    33 *
    44 * Copyright (C) 1998-2002 Peter Graves
    5  * $Id: CommandInterpreter.java,v 1.1 2002-10-15 16:26:03 piso Exp $
     5 * $Id: CommandInterpreter.java,v 1.2 2002-10-16 01:57:07 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4949    {
    5050        super();
     51        initializeUndo();
     52        initializeHistory();
    5153    }
    5254
     
    132134        }
    133135        enter(input);
    134     }
    135 
    136     private String stripPrompt(String s)
    137     {
    138         if (promptRE != null) {
    139             REMatch match = promptRE.getMatch(s);
    140             if (match != null)
    141                 return s.substring(match.getEndIndex());
    142         }
    143         // Look for login name or password prompt.
    144         RE re = new UncheckedRE(".*: ?");
    145         REMatch match = re.getMatch(s);
    146         if (match != null)
    147             return s.substring(match.getEndIndex());
    148         return s;
    149136    }
    150137
     
    178165        resetUndo();
    179166        stripEcho = true;
     167        send(s);
     168    }
     169
     170    protected void send(final String s)
     171    {
    180172        try {
    181173            stdin.write(s.concat("\n"));
     
    185177            Log.error(e);
    186178        }
     179    }
     180
     181    private String stripPrompt(String s)
     182    {
     183        if (promptRE != null) {
     184            REMatch match = promptRE.getMatch(s);
     185            if (match != null)
     186                return s.substring(match.getEndIndex());
     187        }
     188        // Look for login name or password prompt.
     189        RE re = new UncheckedRE(".*: ?");
     190        REMatch match = re.getMatch(s);
     191        if (match != null)
     192            return s.substring(match.getEndIndex());
     193        return s;
    187194    }
    188195
Note: See TracChangeset for help on using the changeset viewer.