Package jline

Examples of jline.History


           
            String historyFile = System.getProperty("user.home") + File.separator + HISTORYFILE;

            try
            {
                History history = new History(new File(historyFile));
                reader.setHistory(history);
            }
            catch (IOException exp)
            {
                css_.err.printf("Unable to open %s for writing%n", historyFile);
View Full Code Here


public class Readline {

    private History history;

    public Readline() {
        history = new History();
    }
View Full Code Here

    try {
      ConsoleReader reader = new ConsoleReader();
      reader.setBellEnabled(false);
      String historyFile = System.getProperty("user.home")
          + File.separator + HISTORYFILE;
      History history = new History(new File(historyFile));
      reader.setHistory(history);

      String prompt;
      String line = "";
      String currentStatement = "";
View Full Code Here

@Command(scope = "shell", name="history", description="Prints command history")
public class HistoryAction extends OsgiCommandSupport {

    @Override
    protected Object doExecute() throws Exception {
        History history = (History) session.get(".jline.history");
        List<String> elements = history.getHistoryList();

        int i = 0;
        for (String element : elements) {
            System.out.println(
                    Ansi.ansi()
View Full Code Here

        rl.singleMimicsWithoutCheck(runtime.origin);
        runtime.ground.setCell("Readline", rl);
        rl.setCell("VERSION", runtime.newText("JLine wrapper"));

        final ConsoleHolder holder = new ConsoleHolder();
        holder.history = new History();
        holder.currentCompletor = null;

        IokeObject history = runtime.newFromOrigin();
        rl.setCell("HISTORY", history);
View Full Code Here

        for (String i : ConsoleSetup.getAllImportStatements()) {
            groovy.execute(i);
        }

        groovy.setResultHook(new ResultHookClosure(groovy, io, resultPrompt));
        groovy.setHistory(new History());

        final InteractiveShellRunner runner = new InteractiveShellRunner(groovy, new PromptClosure(groovy, inputPrompt));
        runner.setErrorHandler(new ErrorHookClosure(runner, io));
        try {
            runner.setHistory(new History(new File(System.getProperty("user.home") + "/" + HISTORY_FILE)));
        } catch (IOException e) {
            io.err.println("Unable to create history file: " + HISTORY_FILE);
        }

        Gremlin.load();
View Full Code Here

    final String HISTORYFILE = ".hivehistory";
    String historyDirectory = System.getProperty("user.home");
    try {
      if ((new File(historyDirectory)).exists()) {
        String historyFile = historyDirectory + File.separator + HISTORYFILE;
        reader.setHistory(new History(new File(historyFile)));
      } else {
        System.err.println("WARNING: Directory for Hive history file: " + historyDirectory +
                           " does not exist.   History will not be available during this session.");
      }
    } catch (Exception e) {
View Full Code Here

    String historyPath = configDir + "/shell_history.txt";
    File accumuloDir = new File(configDir);
    if (!accumuloDir.exists() && !accumuloDir.mkdirs())
      log.warn("Unable to make directory for history at " + accumuloDir);
    try {
      History history = new History();
      history.setHistoryFile(new File(historyPath));
      reader.setHistory(history);
    } catch (IOException e) {
      log.warn("Unable to load history file at " + historyPath);
    }
   
View Full Code Here

    reader.addCompletor(getCommandCompletor());

    String line;
    final String HISTORYFILE = ".hivehistory";
    String historyFile = System.getProperty("user.home") + File.separator + HISTORYFILE;
    reader.setHistory(new History(new File(historyFile)));
    int ret = 0;

    String prefix = "";
    String curPrompt = prompt;
    while ((line = reader.readLine(curPrompt + "> ")) != null) {
View Full Code Here

    //parse command line arguments
    parseArgs(args);

    ConsoleReader cr = new ConsoleReader();
    //Readline.readHistoryFile(fullPath);
    cr.setHistory(new History(new File(historyFile)));
   
    // set completer with list of words
    Completor[] comp = new Completor[]{
            new SimpleCompletor(getCommandsAsArray()),
            new FileNameCompletor()
View Full Code Here

TOP

Related Classes of jline.History

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.