* @param out - output stream to use
* @return 0 for a successful run, -1 if there are any exception
*/
public static int main(String[] args, InputStream in, PrintStream out) {
CommandContext context = new CommandContext();
context.setFormatter(new CommandShellOutputFormatter(out));
// Convert arguments to list for easier management
List<String> tokens = new ArrayList<String>(Arrays.asList(args));
ShellCommand main = new ShellCommand();
try {
main.setCommandContext(context);
main.execute(tokens);
return 0;
} catch (Exception e) {
context.printException(e);
return -1;
}
}