Home / Java Patterns and Pitfalls     frequal.com

Easy Command-Line Parsing with Picocli

Picocli (https://picocli.info/) is a modern take on Java command-line parsing. It features:
  • Annotations for direct option injection into member variables
  • Automatic formatted help generation
  • Easy one-liner usage in main()

Comparison

Older command-line parsing libraries tend to be clunkier and have fewer options. They leave you copying values manually and creating your own help. Plus, picocli has tons of options, more than I can ever imagine using.

Give picocli a try. I suspect, like me, you won't want to use anything else ever again.


Last modified on 29 Oct 2018 by AO

Copyright © 2018 Andrew Oliver