remkop / picocli

Picocli is a modern framework for building powerful, user-friendly, GraalVM-enabled command line apps with ease. It supports colors, autocompletion, subcommands, and more. In 1 source file so apps can include as source & avoid adding a dependency. Written in Java, usable from Groovy, Kotlin, Scala, etc.
https://picocli.info
Apache License 2.0
4.79k stars 414 forks source link

sorting synopsis within ArgGroup #2295

Open crotwell opened 1 month ago

crotwell commented 1 month ago

This does not fix it, but contains a test case for #2294

crotwell commented 1 month ago

Possible solution added, sorts options inside ArgGroup using Help.SortByOptionArityAndNameAlphabetically()

crotwell commented 1 month ago

Two tests still failing, but not clear to me if the test data should just be modified or if keeping "code order" within an ArgGroup is important feature. Especially since "code order" doesn't work with setters, it seems like [ARG1 | ARG2 | ARG3 | -a | -b | -c] should be considered equivalent to [ -a | -b | -c | ARG1 | ARG2 | ARG3] but maybe not.