Skip to main content

Module help

Module help 

Source
Expand description

The one-line summary of how a command is invoked.

Usage: mise use [OPTIONS] <TOOL@VERSION>… — the line at the top of --help, and the first thing a CLI framework has to be able to produce.

Built from the same &'static metadata a parse ignores, so a binary that never asks for help pays nothing for being able to. Nothing here is on the hot path.

§Matching usage-lib

usage-lib renders this from a spec, through a tera template over a runtime model. This crate cannot: there is no Spec at run time, only the tables. So the rules are reimplemented, and the test that matters compares the two outputs over every command in mise’s real spec — 211 of them — because an adopter’s help text changing is a visible regression even when it is a small one.

Where the two disagree the difference is recorded, in the same spirit as the parser’s corpus: usage-lib is the reference, and a divergence is a decision rather than an accident.

Structs§

Style
Whether help output is coloured.
Topic
A named section of one command’s help page.

Enums§

Page
Which page a help request asks for.

Constants§

SECTIONS
The sections a help_template may name.
STYLES
The styles accepted in a help template.

Functions§

find
The path and metadata for a command, found by identity within a spec.
long_help
Everything --help prints.
page
The page a help request becomes, by the route the words took.
page_view
The page a help request becomes when a declared executable view is what the user invoked.
render
The page a help request asks for, ready to print.
render_all
Long help for a command and every visible descendant, in depth-first order.
render_all_at
Recursive long help for a command reached by a known route.
render_all_at_styled
Route-specific recursive long help with an explicit colour policy.
render_all_styled
Recursive long help with an explicit colour policy.
render_all_view_at_styled
Recursive long help through a spec-declared executable view.
render_at
render_at_styled
Render a route-specific help page with an explicit colour policy.
render_styled
Render a help page with an explicit colour policy.
render_topic
Render one addressable help topic by its Topic::id or visible title.
render_view_at_styled
Render help through a spec-declared executable view.
route_to
The route the words took to a command, for rendering its page unambiguously.
route_to_view
Recover a command route from the full argv of a declared executable view.
short_help
Everything -h prints.
topics
List the addressable topics on one command’s short or long help page.
unsupported_section
The first placeholder in a template that names no section, if there is one.
usage_line
The Usage: line’s body, without the Usage: prefix.