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

Sqlline should set error code when -e command fails #391

Closed
vlsi opened this issue Oct 10, 2020 · 0 comments · Fixed by #409
Closed

Sqlline should set error code when -e command fails #391

vlsi opened this issue Oct 10, 2020 · 0 comments · Fixed by #409

Comments

@vlsi
Copy link

vlsi commented Oct 10, 2020

See

if (commands.size() > 0) {
// for single command execute, disable color
getOpts().set(BuiltInProperty.COLOR, false);
getOpts().set(BuiltInProperty.HEADER_INTERVAL, -1);
for (String command : commands) {
debug(loc("executing-command", command));
dispatch(command, new DispatchCallback());
}
exit = true; // execute and exit

$ ./sqlline -e '!tables' && echo $?

Expected: non-zero return code
Actual:

$ ./sqlline -e '!tables' && echo return code is $?
+ java -Xmx1g -Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl -jar build/libs/sqllineClasspath.jar -e '!tables'
No current connection
sqlline version 1.9.0
return code is 0
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

Successfully merging a pull request may close this issue.

1 participant