SamuelSchlesinger / commander-cli

A simple library I wrote to allow me to quickly and easily construct command line interfaces.
MIT License
29 stars 2 forks source link

show example in function documentation #7

Closed BebeSparkelSparkel closed 1 year ago

BebeSparkelSparkel commented 3 years ago

It would be very helpful to have an example argument in the function descriptions.

example: argument

commandName arumentValue

example: keyed argument

commandName -key value
SamuelSchlesinger commented 3 years ago

Oh I'm sorry, I just saw this. I'm not sure if I understand what you mean.. Can you elaborate?

BebeSparkelSparkel commented 3 years ago

Sure

arg :: KnownSymbol name => (x -> ProgramT p m a) -> ProgramT (Arg name x & p) m a
someCommand someArgument
            ^^^arg value^^^

opt :: (KnownSymbol option, KnownSymbol name) => (Maybe x -> ProgramT p m a) -> ProgramT (Opt option name x & p) m a
someCommand -option optionValue
            ^^option^^ ^^option value ^^
only one dash before the option with the a space between it and its value

Enough to describe the command line syntax. Right now it is some what hard to tell what the combinator CLI syntax is.

SamuelSchlesinger commented 3 years ago

Ah, now I understand. If you have a particular idea in mind, please feel free to PR it, otherwise I'll get to it sometime.