final String stg = buff.toString(); try { reader.printString(stg); reader.flushConsole(); } catch (final IOException ignored) {
reader.printString(stg); reader.flushConsole(); } catch (final IOException ignored) {
reader.getCursorBuffer().cursor = cursor; reader.printString(toDisplay);
private void printCommandHelp() throws IOException { _cr.printString( "The following commands are available:\n" + "\n" + " help - show this message\n" + " exit - exit this interpreter\n" + " quit - exit this interpreter\n" + " ls - lists all the local variables\n" + " clear - clears all local variables and functions\n" + " rm [var_name] - clears the given variable\n" ); _cr.printNewline(); }
private void printCommandHelp() throws IOException { _cr.printString( "The following commands are available:\n" + "\n" + " help - show this message\n" + " exit - exit this interpreter\n" + " quit - exit this interpreter\n" + " ls - lists all the local variables\n" + " clear - clears all local variables and functions\n" + " rm [var_name] - clears the given variable\n" ); _cr.printNewline(); }
public static void main(String[] args) throws Exception { properties = System.getProperties(); if (properties.get(WorkloadManager.ZK_SERVER_LIST) == null) { logger.warn(WorkloadManager.ZK_SERVER_LIST + " was not defined setting to localhost:2181"); properties.setProperty(WorkloadManager.ZK_SERVER_LIST, "localhost:2181"); } workloadManager = new WorkloadManager(properties); // TODO parse & apply parameters from CLI // TODO push through config properties file IroncountCli ic = new IroncountCli(); //ic.doExecute(); logger.warn("starting console reader"); ConsoleReader reader = new ConsoleReader(); String line; while ((line = reader.readLine("[ironcount] ")) != null) { if (line.equalsIgnoreCase("exit")) { System.exit(0); } else if (line.equalsIgnoreCase("stop")) { reader.printString("Stopping ironcount workload manager..."); workloadManager.shutdown(); reader.printString("Stopped. \n"); } else if (line.equalsIgnoreCase("start")) { reader.printString("Starting ironcount workload manager..."); workloadManager.init(); reader.printString("OK \n"); } processArgs(line.split(" "), reader); } }
private void processCommand(ConsoleReader reader, String line) throws Exception { // TODO catch command error(s) here, simply errmsg handoff to stdin loop above CommandLine cmd = processArgs(line.split(" ")); if (cmd.hasOption("help")) return; if ( commandArgs.validateCommand() ) { commandRunner.processCommand(commandArgs); } else { reader.printString("Invalid command. Must be one of: read, rangeslice, multiget\n"); printHelp(false); } }
public void showMessage(String message) throws PrompterException { try { consoleReader.printString(message); consoleReader.printNewline(); consoleReader.flushConsole(); } catch (IOException e) { throw new PrompterException("Failed to present prompt", e); } }
_cr.printString( "Symbols : \n\n" ); for( ISymbol symbol : symbols ) _cr.printString( " " + symbol.getName() + " : (builtin)\n" ); _cr.printString( " " + symbol.getName() + " : " + symbol.getType() + " = " + GosuShop.toString( symbol.getValue() ) + "\n" ); if ( _interactiveSymbolTable.getSymbol( sym ) == null ) _cr.printString( "Symbol '" + sym + "' does not exist\n" ); _cr.printString( "Cannot remove built-in symbol '" + sym + "'\n" );
c.printNewline(); c.printNewline(); c.printString("Warning!!! Your instance secret is still set to the default, this is not secure. We highly recommend you change it."); c.printNewline(); c.printNewline(); c.printNewline(); c.printString("You can change the instance secret in accumulo by using:"); c.printNewline(); c.printString(" bin/accumulo " + org.apache.accumulo.server.util.ChangeSecret.class.getName() + " oldPassword newPassword."); c.printNewline(); c.printString("You will also need to edit your secret in your configuration file by adding the property instance.secret to your conf/accumulo-site.xml. " + "Without this accumulo will not operate correctly"); c.printNewline();
_cr.printString( "Type \"help\" to see available commands" ); _cr.printNewline(); _cr.printString( e.getMessage() ); _cr.printString( e.getMessage() == null ? "" : e.getMessage() ); _cr.printNewline(); StringWriter str = new StringWriter(); e.printStackTrace( new PrintWriter( str ) ); _cr.printString( str.toString() );
_cr.printString( "Type \"help\" to see available commands" ); _cr.printNewline(); _cr.printString( e.getMessage() ); _cr.printString( e.getMessage() == null ? "" : e.getMessage() ); _cr.printNewline(); StringWriter str = new StringWriter(); e.printStackTrace( new PrintWriter( str ) ); _cr.printString( str.toString() );
final String stg = buff.toString(); try { reader.printString(stg); reader.flushConsole(); } catch (final IOException ignored) {
reader.printString(new ANSIBuffer().append(message).toString()); break; case SUCCESS: reader.printString(new ANSIBuffer().green(message).toString()); break; case FAILURE: reader.printString(new ANSIBuffer().red(message).toString()); break;
consoleReader.printString(formattedMessage); line = consoleReader.readLine(boldIfPossible("Choose a number: ")); invalid = ansiBuffer.toString(); consoleReader.printString(invalid); consoleReader.printNewline();
protected Object interactivelyEvaluate( String expr ) throws ParseResultsException, IOException { IGosuProgram gosuProgram = parseProgram( expr ); IProgramInstance instance = gosuProgram.getProgramInstance(); Object val = instance.evaluate( new ExternalSymbolMapSymbolTableWrapper( _interactiveSymbolTable, true ) ); processProgram( gosuProgram, instance ); IExpression expression = gosuProgram.getExpression(); boolean noReturnValue = expression == null || JavaTypes.pVOID().equals(expression.getType()) || expression instanceof INotAWordExpression; if (!noReturnValue && _logOutput ) { _cr.printString( OUTPUT_PREFIX + GosuShop.toString( val ) ); _cr.printNewline(); } return val; }
protected Object interactivelyEvaluate( String expr ) throws ParseResultsException, IOException { IGosuProgram gosuProgram = parseProgram( expr ); IProgramInstance instance = gosuProgram.getProgramInstance(); Object val = instance.evaluate( new ExternalSymbolMapSymbolTableWrapper( _interactiveSymbolTable, true ) ); processProgram( gosuProgram, instance ); IExpression expression = gosuProgram.getExpression(); boolean noReturnValue = expression == null || JavaTypes.pVOID().equals(expression.getType()) || expression instanceof INotAWordExpression; if (!noReturnValue && _logOutput ) { _cr.printString( OUTPUT_PREFIX + GosuShop.toString( val ) ); _cr.printNewline(); } return val; }
reader.printString(stg); reader.flushConsole(); } catch (final IOException ignored) {
reader.getCursorBuffer().cursor = cursor; reader.printString(toDisplay);
invalid = ansiBuffer.toString(); consoleReader.printString(invalid); consoleReader.printNewline();