| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Okf.Cli.Help
Description
Conceptual help topic guides for the okf CLI.
Each topic's content lives in a standalone plain-text file under
okf-clihelp and is embedded into the binary at compile time with
file-embed's embedStringFile splice. The shipped okf executable is
therefore self-contained: okf help okf works with no extra files on disk
and no network access.
Topic files are written as terminal-oriented plain text (ALL-CAPS section headers, 2-space indented bodies) and printed verbatim; there is no Markdown rendering step.
Synopsis
- data HelpCommand
- = ListTopics
- | ShowTopic !Text
- data HelpTopic = HelpTopic {
- topicName :: !Text
- topicDescription :: !Text
- topicContent :: !Text
- helpTopics :: [HelpTopic]
- helpCommandParser :: Parser HelpCommand
- handleHelpCommand :: HelpCommand -> IO ()
Documentation
data HelpCommand Source #
A bare help lists topics; help topic shows one.
Constructors
| ListTopics | |
| ShowTopic !Text |
Instances
| Show HelpCommand Source # | |
Defined in Okf.Cli.Help Methods showsPrec :: Int -> HelpCommand -> ShowS # show :: HelpCommand -> String # showList :: [HelpCommand] -> ShowS # | |
| Eq HelpCommand Source # | |
Defined in Okf.Cli.Help | |
A single help guide: short name, one-line description, embedded content.
Constructors
| HelpTopic | |
Fields
| |
Instances
helpTopics :: [HelpTopic] Source #
All available help topics, in display order.
helpCommandParser :: Parser HelpCommand Source #
Parse help [TOPIC]. With no argument, 'pure ListTopics' wins via <|>.
handleHelpCommand :: HelpCommand -> IO () Source #
Run the help command: list the topic index or print one topic.