Previous

Release v0.9.0 - Bash completion and ArgBinder validation

Current

Release v0.10.0 - Command Resolver and Double Dash raw args

Next

Release v0.11.0 - Too much to summarise

Release v0.10.0 - Command Resolver and Double Dash raw args

The latest release of JCLI has been released, featuring the new CommandResolver helper.

Changelog

The following changes were implemented:

  1. Feature - Add CommandResolver, an abstraction around a tree used to resolve commands..
  2. Feature - You can now use two dashes instead of three to create a raw arg list. (Thanks andrey-zherikov)
  3. Testing - Added an example to demonstrate raw arg lists. (Thanks andrey-zherikov)
  4. Documentation - Bunch of minor doc tweaks.
  5. Fix - One overload of addFileConfig didn't actually compile when used.

Command Resolver

Since the philosophy of JCLI is to provide reusable components so that you're not locked into having to use CommandLineInterface, I 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 CommandResolver class.

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.

Contributors ❤️

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.

Previous

Release v0.9.0 - Bash completion and ArgBinder validation

Current

Release v0.10.0 - Command Resolver and Double Dash raw args

Next

Release v0.11.0 - Too much to summarise