top | item 23319172

(no title)

dashwav | 5 years ago

Since everyone else is throwing out recommendations I personally think https://github.com/spf13/cobra is the best CLI templating system, especially because of how well it pairs with https://github.com/spf13/viper.

Large projects like Hugo and Kubernetes have used Cobra to build their CLI tools, and it's fairly light as well even if you need simpler usage. We use it at my workplace simply for wrapping our microservices and the few commands (serve, migrate, etc)

discuss

order

martinni|5 years ago

Don't think cobra and viper should be the default CLI framework. They're useful but overkill for most use case. I personally find that the standard lib has more than enough power to do everything.

Thorentis|5 years ago

Great stuff! Does anything like Cobra exist for Java?

pansa2|5 years ago

Same question, but for C++?

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

brown9-2|5 years ago

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