pcapriotti / pcapriotti/optparse-applicative
How do I print help info with colored command names?
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 959
- Forks
- 123
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 1
Description
Hello! I'm having trouble finding a solution to this. Is something like this currently possible?
optparse-applicative version: 0.17.0.0
Currently, what I tried to so far -
import Options.Applicative (Parser, (<**>))
import qualified Options.Applicative as O
import qualified Options.Applicative.Help as OH
main :: IO ()
main = pure =<< O.customExecParser (O.prefs O.showHelpOnEmpty) opts
where
opts =
O.info
(myCommands <**> O.helper)
( O.fullDesc <> O.progDesc "")
myCommands :: Parser a
myCommands =
O.subparser $
O.command
"myCommand"
( O.info
O.empty
(O.progDesc "description here")
)
<> O.style OH.green
but I got the "metavar" part of it colored green instead, not myCommand which is what I'm looking for:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Options.Applicative.Help and the customExecParser/style usage shown in the example, then reproduce the output with optparse-applicative 0.17.0.0. Determine whether styling can apply to the command name rather than its metavar; done means help output colors myCommand while leaving the metavar behavior correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100