bootique icon indicating copy to clipboard operation
bootique copied to clipboard

Consider using picocli

Open remkop opened this issue 5 years ago • 3 comments

Unsure if this has been considered before, but it may be interesting to replace joptsimple with picocli.

There could be several benefits, depending on whether this is limited to an internal change or whether you want to go further.

End user benefits:

  • usage help with ANSI colors and styles. This doesn’t just look good, it also reduces the cognitive load on end users: the contrast make important information like commands, options, and parameters stand out from the surrounding text.
  • @-files to load arguments from files

Maintenance benefits:

Depending on how much you like this idea, you could consider allowing users to create custom bootique-based CLI applications using the picocli API directly, similar to Micronaut's approach.

Thoughts?

remkop avatar May 07 '19 12:05 remkop

Thanks for the pointer. In fact we considered replacing jopt with our own CLI parser as a part of the general effort to remove 3rd party dependencies. Will certainly take a look at Picocli. We do need something more advanced.

andrus avatar May 07 '19 15:05 andrus

Ok, interesting. You may like the fact that picocli is in a single source file so applications also have the option to include it as source to avoid the external dependency.

But take a look at whether picocli's functionality is attractive or whether you would rather develop this in-house. Are you mainly interested in using this internally in Bootique or are you considering offering/expanding an external API for applications to create Bootique-based CLI applications?

Let me know if I can help. -Remko

remkop avatar May 08 '19 02:05 remkop

Update: picocli 4.0 adds some features that may be of interest:

... and more. See the 4.0 release notes for more detail.

I'd be happy to help if there is interest.

remkop avatar Aug 08 '19 03:08 remkop

We still haven't got around to reworking options handling (that's probably Bootique 4.0). But the consensus is that we are not going to add any new third-party dependencies to the Bootique core, and will be working towards getting rid of most of the current ones.

andrus avatar Jan 22 '24 20:01 andrus