Hacker News new | ask | show | jobs
by Thorentis 2215 days ago
Great stuff! Does anything like Cobra exist for Java?
3 comments

Absolutely! I've used picocli[1] and airline[2]. There is always the Apache Commons CLI if you feel like building it all yourself.

1: https://picocli.info/

2: https://github.com/airlift/airline

Bonus: picocli lets you create native images using Graal, so you can really build native cli executable using Java.

Same question, but for C++?

I’ve struggled to find a well-supported command-line argument parser that supports subcommands.

argparse4j is really easy to use and feels similar to argparse in Python.