-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat: new CLI parameter to execute a command and quit (without CLI interaction) #6267
Conversation
Just to clarify: For streaming results like push queries without a limit clause, you need to also issue ctrl+c to interrupt the console, correct? |
It might be worth considering a flag to send the raw JSON to stdout. This way it could be piped to other scripts like |
@colinhicks Ctrl+C is part of the stream. The example of the Description shows the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than a couple minor comments inline. Also, is there a place in the docs we can add this?
@SuppressWarnings("unused") // Accessed via reflection | ||
@Option( | ||
name = {EXECUTE_OPTION, EXECUTE_SHORT_OPTION}, | ||
description = "Execute a command and quit.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the user may not understand "command" - maybe "run one or more ksql statements and quit."?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
} catch (final EndOfFileException exception) { | ||
// Ignore - only used by runInteractively() to exit the CLI | ||
} catch (final Exception exception) { | ||
LOGGER.error("", exception); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the empty log message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I think @rodesai meant to check the green tick
Description
Fixes #4981
Adds a new paramter to the CLI to execute a command and quit. This without having to interact with the CLI console.
You can use a different output format to easily parse the command result. For instance, JSON:
Testing done
Added unit tests
Verified manually
Reviewer checklist