Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve the R console output printing
  • Loading branch information
Valentin Georgiev committed Apr 30, 2012
1 parent e011213 commit b99e52b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
Expand Up @@ -101,12 +101,25 @@ public static String fixFilepath(String filepath) {
public static String parseCommand(String command) {
String[] cmd = command.split(cmdparser);
StringBuilder builder = new StringBuilder();
for (String s : cmd)
if (!s.startsWith("#") && s.length() != 0) {
builder.append(s);
builder.append(NEWLINE);
for (int i = 0; i<cmd.length; i++)
if (!cmd[i].startsWith("#") && cmd[i].length() != 0) {
builder.append(cmd[i]);
// if (i < (cmd.length - 1)) {
builder.append("\n");
// }
}
String cmdstr = builder.toString();
return cmdstr;
}

public static String[] breakCommand(String command) {
String[] cmd = command.split(cmdparser);
ArrayList<String> list = new ArrayList<String>();
for (String s : cmd)
if (!s.startsWith("#") && s.length() != 0) {
list.add(s);
}
cmd = list.toArray(new String[list.size()]);
return cmd;
}
}
Expand Up @@ -80,7 +80,7 @@ protected String evalCommand(String command, boolean quotes) {
echoCommand(command); //echo the array of strings
}
if (output.length() != 0) {
printMessage(output);
printMessage(NEWLINE + output);
}
return output;
}
Expand All @@ -107,7 +107,9 @@ protected void waitUntilCommandFinished() {
}

void echoCommand(final String command) {
printMessage(NEWLINE + "> " + command + NEWLINE);
String[] cmd = RunUtil.breakCommand(command);
for (String c : cmd)
printMessage(NEWLINE + "> " + c);
}

@Override
Expand Down

0 comments on commit b99e52b

Please sign in to comment.