From 6ff5ae190daa8260e985f3a6996ecaf2f10ddc75 Mon Sep 17 00:00:00 2001 From: Shenghao Yang Date: Sat, 21 Nov 2020 17:02:48 +0800 Subject: [PATCH] examples/ola-streaming-client: Rename universe from STDIN option name and clarify usage --- examples/ola-streaming-client.cpp | 17 ++++++++--------- man/ola_streaming_client.1 | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/examples/ola-streaming-client.cpp b/examples/ola-streaming-client.cpp index c524e95bd4..daa5425bbe 100644 --- a/examples/ola-streaming-client.cpp +++ b/examples/ola-streaming-client.cpp @@ -41,12 +41,11 @@ DEFINE_s_string(dmx, d, "", "Comma separated DMX values to send, e.g. " DEFINE_s_uint32(universe, u, 1, "The universe to send data for"); DEFINE_uint8(priority, ola::dmx::SOURCE_PRIORITY_DEFAULT, "The source priority to send data at"); -DEFINE_s_default_bool(universe_from_source, s, false, - "Read universe number from source. Only allowed when " - "processing STDIN. The universe number must be formatted " - "in base 10, and be separated by at least one whitespace " - "character from the start and end of the sequence of " - "DMX values."); +DEFINE_s_default_bool(universe_from_stdin, s, false, + "Also read the destination universe number from STDIN " + "when reading DMX data from STDIN. The universe number " + "must precede the channel values, and be delimited " + "by whitespace. E.g. 1 0,255,128 2 0,255,127."); bool terminate = false; @@ -88,7 +87,7 @@ int main(int argc, char *argv[]) { unsigned int read_universe = FLAGS_universe; while (!terminate && std::cin >> input) { - if (!have_universe && FLAGS_universe_from_source) { + if (!have_universe && FLAGS_universe_from_stdin) { if (!ola::StringToInt(input, &read_universe, true)) { OLA_FATAL << "Could not convert universe number."; exit(1); @@ -98,13 +97,13 @@ int main(int argc, char *argv[]) { continue; } - if (have_universe || !FLAGS_universe_from_source) { + if (have_universe || !FLAGS_universe_from_stdin) { SendDataFromString(&ola_client, read_universe, input); have_universe = false; } } } else { - if (FLAGS_universe_from_source) { + if (FLAGS_universe_from_stdin) { OLA_FATAL << "Not reading from STDIN. Use -u to specify universe."; exit(1); } diff --git a/man/ola_streaming_client.1 b/man/ola_streaming_client.1 index 8ce44bf3c6..28df88bc8c 100644 --- a/man/ola_streaming_client.1 +++ b/man/ola_streaming_client.1 @@ -14,8 +14,8 @@ Display the help message. Comma separated DMX values to send, e.g. 0,255,128 sets first channel to 0, second channel to 255 and third channel to 128. .IP "-l, --log-level " Set the logging level 0 .. 4. -.IP "-s, --universe-from-source" -Read universe number from source. Only allowed when processing STDIN. The universe number must be formatted in base 10, and be separated by at least one whitespace character from the start and end of the sequence of DMX values. +.IP "-s, --universe-from-stdin" +Also read the destination universe number from STDIN when reading DMX data from STDIN. The universe number must precede the channel values, and be delimited by whitespace. E.g. 1 0,255,128 2 0,255,127. .IP "-u, --universe " Id of the universe to send data for. .IP "-v, --version"