Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need parses arguments firstly when we want to set historyFile #477

Open
chaijunjie0101 opened this issue Dec 23, 2022 · 0 comments
Open

Comments

@chaijunjie0101
Copy link

chaijunjie0101 commented Dec 23, 2022

if we want to set historyFile like this
java -cp {jars} sqlline.SqlLine --historyFile=myfile...
but it also be set as default
In the SqlLine.java
, we need parses arguments firstly

History fileHistory = new DefaultHistory();
LineReader reader;
boolean runningScript = getOpts().getRun() != null;
if (runningScript) {
  try {
    FileInputStream scriptStream =
        new FileInputStream(getOpts().getRun());
    reader = getConsoleReader(scriptStream, fileHistory);
  } catch (Throwable t) {
    handleException(t);
    commands.quit(null, new DispatchCallback());
    return Status.OTHER;
  }
} else {

// set a default fileHistory
reader = getConsoleReader(inputStream, fileHistory);
}

final DispatchCallback callback = new DispatchCallback();

// parse args include --historyFile
Status status = initArgs(args, callback);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant