View | Details | Raw Unified | Return to bug 22428
Collapse All | Expand All

(-)src/main/org/apache/tools/ant/Main.java (-1 / +15 lines)
Lines 145-150 Link Here
145
     */
145
     */
146
    private static boolean isLogFileUsed = false;
146
    private static boolean isLogFileUsed = false;
147
147
148
    /** loop mode */
149
    private static boolean loopMode = false;
150
  
148
    /**
151
    /**
149
     * Prints the message of the Throwable if it (the message) is not
152
     * Prints the message of the Throwable if it (the message) is not
150
     * <code>null</code>.
153
     * <code>null</code>.
Lines 193-199 Link Here
193
        }
196
        }
194
197
195
        try {
198
        try {
196
            m.runBuild(coreLoader);
199
            boolean continueLoop = false;
200
            do {
201
              m.runBuild(coreLoader);
202
              if ( loopMode ) {
203
                System.out.println( "\nPress Enter to continue or q + Enter to quit" );
204
                char key = (char) System.in.read();
205
                continueLoop = key != 'q' && key != 'Q';
206
              }
207
            } while ( continueLoop );
197
            System.exit(0);
208
            System.exit(0);
198
        } catch (BuildException be) {
209
        } catch (BuildException be) {
199
            if (m.err != System.err) {
210
            if (m.err != System.err) {
Lines 385-390 Link Here
385
                    System.out.println(msg);
396
                    System.out.println(msg);
386
                    return;
397
                    return;
387
                }
398
                }
399
            } else if (arg.equals("-loop")) {
400
                loopMode = true;
388
            } else if (arg.startsWith("-")) {
401
            } else if (arg.startsWith("-")) {
389
                // we don't have any more args to recognize!
402
                // we don't have any more args to recognize!
390
                String msg = "Unknown argument: " + arg;
403
                String msg = "Unknown argument: " + arg;
Lines 753-758 Link Here
753
        msg.append("  -inputhandler <class>  the class which will handle input requests" + lSep);
766
        msg.append("  -inputhandler <class>  the class which will handle input requests" + lSep);
754
        msg.append("  -find <file>           search for buildfile towards the root of the" + lSep);
767
        msg.append("  -find <file>           search for buildfile towards the root of the" + lSep);
755
        msg.append("                         filesystem and use it" + lSep);
768
        msg.append("                         filesystem and use it" + lSep);
769
        msg.append("  -loop                  loop mode" + lSep);
756
        System.out.println(msg.toString());
770
        System.out.println(msg.toString());
757
    }
771
    }
758
772

Return to bug 22428