You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The help messages generated by case-app are currently rather raw. All the options are printed, without any grouping of related options, with no reflow of text depending on the terminal width, no colors, etc. For example:
$ cs launch --help
Command: launch
Usage: cs launch <org:name:version|app-name[:version]*>
--main-class | -M | --main <string>
--extra-jars <string*>
Extra JARs to be added to the classpath of the launched application. Directories accepted too.
--property | -D <key=value>
Set Java properties before launching the app
--fork <bool?>
…
(there's approx. ~70 options like this in this command!)
scopt or picocli could be used as sources of inspiration (there's probably many other libraries worth a look too…)
About implementing that, colors and reflow should just be a matter of changing some methods in Help.
Grouping arguments is more tricky I think, and requires some changes in the typelevel core of case-app. In more detail, I believe it should be possible to group arguments, by
adding a val group: String = "" argument to Recurse,
in HListParserBuilder.hconsRecursive, we should be able to call recurse.head in a typesafe way, and pass recurse.head.group to RecursiveConsParser.
We should then adjust RecursiveConsParser.args, so that it prepends its group (if it has one) to each of the Args it returns.
Lastly, in Help, we can then use the Arg.group of its args to group / show arguments however we want in the help message generated there. I didn't actually try to implement it, hopefully I didn't miss blockers along the way.
The help messages generated by case-app are currently rather raw. All the options are printed, without any grouping of related options, with no reflow of text depending on the terminal width, no colors, etc. For example:
(there's approx. ~70 options like this in this command!)
scopt or picocli could be used as sources of inspiration (there's probably many other libraries worth a look too…)
About implementing that, colors and reflow should just be a matter of changing some methods in
Help
.Grouping arguments is more tricky I think, and requires some changes in the typelevel core of case-app. In more detail, I believe it should be possible to group arguments, by
val group: String = ""
argument toRecurse
,recurse: HList
argument toHListParserBuilder.apply
, and passing itrecurse
around here,group: List[String]
field toArg
,group: Option[String]
field toRecursiveConsParser
,HListParserBuilder.hconsRecursive
, we should be able to callrecurse.head
in a typesafe way, and passrecurse.head.group
toRecursiveConsParser
.We should then adjust
RecursiveConsParser.args
, so that it prepends its group (if it has one) to each of theArg
s it returns.Lastly, in
Help
, we can then use theArg.group
of itsargs
to group / show arguments however we want in the help message generated there. I didn't actually try to implement it, hopefully I didn't miss blockers along the way.Users would then be able to group arguments like
The text was updated successfully, but these errors were encountered: