Release v0.10.0 - Command Resolver and Double Dash raw args
The latest release of JCLI has been released, featuring the new CommandResolver helper.
The following changes were implemented:
- Feature - Add CommandResolver, an abstraction around a tree used to resolve commands..
- Feature - You can now use two dashes instead of three to create a raw arg list. (Thanks andrey-zherikov)
- Testing - Added an example to demonstrate raw arg lists. (Thanks andrey-zherikov)
- Documentation - Bunch of minor doc tweaks.
- Fix - One overload of
addFileConfigdidn't actually compile when used.
Since the philosophy of JCLI is to provide reusable components so that you're not locked into having to use
found it a bit weird that the command resolver was so heavily tied into
CommandLineInterface itself. So, I took a decent chunk out of it
and remodeled it into the
Its documentation goes into the details, but it's basically just an abstraction around a tree, where each branch in the tree is a word of a command/subcommand.
Leaves are called "Final words", and non-leaves are called "Partial words". This allows CommandResolver and your own code to detect when there's only been a partial match to a full command.
While the performance of
CommandResolver should technically be slower and have more memory usage, in practice it shouldn't make even the
slightest difference. Also, taking something that was heavily embedded into one class, and turning it into something more reusable, is obviously
going to likely make it perform worse as it tries to support a more general case.
The following people (other than myself) have contributed to this release of JCLI:
- andrey-zherikov - Fixed up a typo, as well as indirectly alerting me of some of the rough edges that raw arg lists had.