"and there are simply no good command line input parsing libraries for Java." Looks like author missed the most obvious and popular OSS one: https://picocli.info/. - Source: Hacker News / about 1 year ago
The command line example gave me the "ick". It is usually preferrable to parse the command line arguments into one instance of a custom "command class", rather than into a list of things. Like jcommander, picocli or jbock do. Source: about 1 year ago
Complex argument parsing needs to be auto-generated by libraries like picocli. Even if you need something custom, it'd be quicker to write an Annotation processor from scratch than editing that file. Source: over 1 year ago
Using picocli to handle your command line options gives you the best chance to automatically generate an ArgumentCompleter script in the future, but won't help you today (other than possibly making your command line handling more standardized & easier). Source: over 1 year ago
Then we released a JBang! And picocli based cli that would be, on any OS running a jvm runtime :. - Source: dev.to / over 1 year ago
I generally tend to simplify this either through third-party libraries such as picoli or Spring Shell. Source: almost 2 years ago
It looks to have even more features than Picocli. Source: about 2 years ago
I think you are looking for https://picocli.info/ - has info on how to build and distribute Java command-line apps, including using GraalVM to generate a single file native executable. Source: about 2 years ago
For actual user interface, I would start with a terminal. I want to open a temrinal, write the name of my program, possibly with some arguments, the program starts and I see a prompt, and then I can write simple commands and the program does stuff. This way I can learn about parsing arguments (something like what picocli is doing in Java) but also about working with strings: parsing them, splitting, converting... Source: about 2 years ago
Pico CLI is a great CLI library and will be one of the first to pop up when you google “java CLI libraries”. Source: over 2 years ago
I really like PicoCLI, I think that if you look at this source file, you can easily see why. It makes coding a command line app trivial. You get gorgeous CLI APIs with highlighting, completion, smart grouping and so much more. It even has a preprocessor, which makes it easy to compile it with GraalVM. - Source: dev.to / over 2 years ago
For the CLI, I used PicoCLI. I meant to write about it ages ago and was bogged down with other things. I researched dozens of CLI tools for Java when we started Lightrun. They were all just awful. I like an opinionated approach as much as the next person, but they literally didn't let me define the syntax of the CLI code. - Source: dev.to / over 2 years ago
As a developer, there is a large chance that you use Command Line Interfaces (CLIs) every day. From Git, to kubectl or Maven, they are everywhere. In this article, we'll look into use cases where CLIs are a great idea. We'll also dive into best practises, and discover one of the most used library for CLIs in the JVM world : picoCLI. - Source: dev.to / over 2 years ago
To read more on picocli go to their website with documentation and other guides here. Source: almost 3 years ago
Thank you for the suggestions. I actually started with Clikt, but found the documentation regarding testing insufficient. Especially, comparing stdout from an executed test was not obvious… for picocli this is documented directly https://picocli.info/#_execution_configuration. Source: almost 3 years ago
Sometimes I like to throw in CLI applications into the mix, even though it seems ridiculous for Spring, it can be kinda nice to get used to it. The picocli framework has a nice integration with Spring Boot, which is just another way to play with using Spring components. Source: almost 3 years ago
A main class entry is used to create the appropriate entry in MANIFEST.MF file which makes the jar file executable directly on command line like java -jar file <.option> but of course you can use java -cp jarfile [args...]... But having multiple mainclasses does not make sense nor could it be configured via pom file... It could be an option to create a cli application which handles the different "main classes"... Source: about 3 years ago
Clikt is pretty standard for anything Kotlin but I personally much prefer picoCLI. It is Java and slightly more clunky but the documentation is insanely extensive, the developer ready to help you at any moment and there are lots of big projects using it (junit, spring, even including some Kotlin projects like Ktlint) so you're sure it's future proof. Source: about 3 years ago
I think, you can use libs for that. ex: Clikt, kotlinx.cli, picocli. Source: about 3 years ago
Do you know an article comparing picocli to other products?
Suggest a link to a post with product alternatives.
This is an informative page about picocli. You can review and discuss the product here. The primary details have not been verified within the last quarter, and they might be outdated. If you think we are missing something, please use the means on this page to comment or suggest changes. All reviews and comments are highly encouranged and appreciated as they help everyone in the community to make an informed choice. Please always be kind and objective when evaluating a product and sharing your opinion.