while(line != null) {
batch.add(ctx.toBatchedCommand(line));
line = reader.readLine();
}
} catch(IOException e) {
batchManager.discardActiveBatch();
throw new CommandLineException("Failed to read file " + f.getAbsolutePath(), e);
} catch(CommandFormatException e) {
batchManager.discardActiveBatch();
throw new CommandLineException("Failed to create batch from " + f.getAbsolutePath(), e);
} finally {