Previously if there was an option which took multiple arguments, the parser
always returned a flat array of all values given for that option, regardless of
how many arguments it expected. E.g. the following:
cmd --file-pair f1 f2 --file-pair a b
resulted in the following:
file-pair: [ f1, f2, a, b ]
For the case where the option is defined as taking only one argument, this
behavior is unchanged, but for the cases where the option is defined as taking
more than one option, an array of arrays is returned instead. For the above
example the result is now:
file-pair: [ [f1, f2], [a, b] ]
The behavior is the same for options with variable arguments. The following:
cmd --set f1 f2 --set a b c --set last
results in:
file-pair: [ [f1, f2], [a, b, c], [last] ]
Always explicitly set the bold parameter 0 for normal, 1 for bold. Once set,
the text remains bold even after a color change until it is explicitly set back
to normal.
* LightOptionParser will only make one pass through the arguments array.
* Make LOP support multiple instances of an option (-i in1 -i in2)
* Make LOP support indeterminate option argument lengths
(using arguments: "variable" in the definition).
* Add unit tests for LightOptionParser and a testing phase during the `package`
build target.
* Default port is no 80.
* Support for HTTP Basic Authentication.
* Support for HTTPS.
* Support for Content-Type. Defaults to "applicaion/json" but also supports
passing a map to be encoded as "application/x-www-form-urlencoded".
* NonBlockingInputStreamReader now has pause() and resume(). The reader will
stop listening to input when pause() is invoked and will skip all available
input once resume() is invoked, ignoring any buffered input entered while it
was paused.
* Bumped the version to 2.0. This version change should have been made instead
of 1.11, as that was a breaking change, altering the package name of several
classes.
LightOptionParser
-----------------
Lightweight, fairly featureful option parsing mechanism idiomatic to Groovy.
Takes in a map of parameter definitions and returns a map of option values and
arguments.
NullOutputStream
----------------
Ignores all data sent its way.
ParameterizedSocket
-------------------
Added trace and debug logging to the message handling code.
SmartConfig
-----------
Fixed a bug where a property lookup on a non-existent property with no default
given caused a null pointer exception trying to resolve the class of the default
value.
ParameterizedSocket
-------------------
Moved from transmitting a list of strings (represented by ASCII data separated
by ASCII record separators `0x1E`) to a combination of strings and paired
strings. Basically, instead of each record being processed as a whole, a record
may optionall contain the ASCII unit separator `0x1F`. If it does, the record
will be split and treated as a key-value pair. This is implemented in the
`ParameterizedSocket.Message` class.o
LoggerOutputStream
------------------
Was not initializing the internal buffer.
ParameterizedSocket
-------------------
This is a wrapper around the basic java.net.Socket class that supports sending
and receiving messages with parameters. It exposes two methods:
`void sendMessage(String... message)` and `String[] receiveMessage()`. The
line-level format of the message is:
START_TOKEN param [SEPARATOR param ...] END_TOKEN
Where `START_TOKEN` is the ASCII "Start heading" control code `0x01`,
`SEPARATOR` is the ASCII "record separator" code `0x1E`, and `END_TOKEN` is the
ASCII "end of transmission" code `0x03`.
LoggerOutputStream
------------------
An OutputStream implementation that flushes to an org.slf4j.Logger instance.
The log level is configurable. It is important to note that data written to
the stream accumulates in an internal buffer until `flush()` is called. At this
point the data is written out as one log message to the logger. It is expected
that one would wrap this stream in an auto-flushing PrintStream or PrintWriter
in actual use.
Default behavior in SmartConfig was wrong. What it should be (and now is) is
when a value is requested but not present, the value is set and returned with
the default if given, or null is returned if no default is given.
* Changed the behavior of SmartConfig when setting file type properties. Now it
tries to coerce the given value into a File object if it is not already a File
object.
* Changed the behavior of SmartConfig when retrieving a property without
specifying a default value. Now it returns null if the property is not set and
no default is given.
* Added `SmartConfig.load()` to allow runtime reloading of config.
* Added `WrappedPrinter` which allows you to print horizontally aligned and
offset text blocks in a monotype environment.