Skip to main content

Module cli

Module cli 

Source
Expand description

CLI surface constants shared by the main dispatcher and the snapshot tests.

CLI_VERSION MUST equal env!("CARGO_PKG_VERSION")build.rs enforces this at compile time so cosmetic edits to Cargo.toml can never desync the Homebrew / Scoop contract documented in docs/CLI.md. mkit version MUST emit exactly "mkit <X.Y.Z>\n".

Constants§

CLI_VERSION
Version string rendered by mkit version. Pinned to the package version at compile time via env!.
COMMIT_EDITMSG_TEMPLATE
Template written into .mkit/COMMIT_EDITMSG before spawning $EDITOR. Pinned by snapshot tests.
HELP_TEXT
Full help text for mkit --help / mkit help / mkit (with no args). Pinned by snapshot tests so downstream tooling that greps the binary output sees a stable surface.

Functions§

strip_comments_and_trim
Strip lines beginning with # (after any leading whitespace) and trim surrounding whitespace. Used by mkit commit when .mkit/COMMIT_EDITMSG is edited via $EDITOR.