Skip to main content

Module usage

Module usage 

Source
Expand description

Mise Usage spec from a clap command. Mise Usage spec from a clap Command.

One hidden flag, one mount line, one operator form. A consumer writes --usage-spec[=BIN] (hidden, require_equals). The served mise task carries mount_line. Operators then run mise run q status — no --. The -- in the mount is only the completion bootstrap, as mise documents.

Lefthook calls the same task: mise run q close-from-git.

Functions§

mount_line
The #USAGE mount line a served mise file task carries.
spec
Render a Usage KDL spec for a mise-mounted task named bin.
spec_bin
Parse --usage-spec / --usage-spec=BIN from argv (after the program name).
take
If argv contains --usage-spec[=BIN], print the spec for C and return ExitCode::SUCCESS.