Skip to content

Simple Spring Queries #92

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

Merged
merged 3 commits into from
Jun 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions src/main/kotlin/io/rsocket/cli/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ class Main : Runnable {
var metadata: String? = null

@Option(names = ["--metadataFormat"], description = ["Metadata Format"])
var metadataFormat = "json"
var metadataFormat: String? = null

@Option(names = ["--dataFormat"], description = ["Data Format"])
var dataFormat = "binary"
var dataFormat: String? = null

@Option(names = ["--setup"], description = ["String input or @path/to/file for setup metadata"])
var setup: String? = null
Expand Down Expand Up @@ -141,7 +141,7 @@ class Main : Runnable {
}
}

private suspend fun exec(): Void? {
private suspend fun exec() {
configureLogging(debug)

if (!this::outputHandler.isInitialized) {
Expand All @@ -152,9 +152,27 @@ class Main : Runnable {
inputPublisher = LineInputPublishers(outputHandler)
}

if (route != null) {
if (metadataFormat == null) {
metadataFormat = "composite"
}

if (dataFormat == null) {
dataFormat = "json"
}
} else {
if (metadataFormat == null) {
metadataFormat = "json"
}

if (dataFormat == null) {
dataFormat = "binary"
}
}

val uri = sanitizeUri(target ?: throw UsageException("no target specified"))

return if (serverMode) {
if (serverMode) {
server = buildServer(uri)

server.onClose().awaitFirstOrNull()
Expand Down
1 change: 1 addition & 0 deletions zsh/_rsocket-cli
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ _rsocket_cli() {
--channel'[Channel]' \
--fnf'[Fire And Forget]' \
--metadataPush'[Metadata Push]' \
--route='[Spring Route]' \
--server'[Server]' \
{-i,--input}='[Input string input or @path/to/file]' \
{-m,--metadata}='[Metadata input string input or @path/to/file]' \
Expand Down