Crate chkc_help

Crate chkc_help 

Source
Expand description

tiny clap help renderer with markdown output and a bit of color.

the flow is simple:

  • parse args with clap and send your match arm into help_command (or the _docs variant if you registered extra notes)
  • HelpPage turns clap metadata into markdown-friendly structs
  • renderer prints it with termimad, scrolling automatically if it doesn’t fit
  • HelpTheme keeps colors consistent and swappable

everything is re-exported from here so you rarely need to dig into submodules.

Structs§

CommandDoc
extra help metadata layered on top of clap output.
DocRegistry
holds every command doc and guide for the current program session.
HelpArgs
args for your help command.
HelpPage
everything we need to print help for a command path.
HelpTheme
accent-aware theme used by the renderer.
MadSkin
A skin defining how a parsed markdown appears on the terminal (fg and bg colors, bold, italic, underline, etc.)

Enums§

Color
Represents a color.
HelpTarget
resolved help target (a command path, a guide, or the program root).

Functions§

apply_accent
tweak a MadSkin in-place to carry the accent through headers, bold, strikeouts, etc.
help_command
handle a help <topic> command without custom docs.
help_command_docs
like help_command but with an attached DocRegistry.
help_command_program
show program help when no command was provided.
help_command_program_docs
program help with attached docs.
render_command_help
render a help page, falling back to a scrollable view if it doesn’t fit on screen.
resolve_help
walk the clap tree to find the thing the user asked for.
run_help_topic
shared execution path for all help entrypoints.
run_scrollable_help
open a scrollable markdown view with keyboard and mouse shortcuts.