Skip to main content

Crate sandogasa_cli

Crate sandogasa_cli 

Source
Expand description

Shared CLI utilities for sandogasa tools.

Re-exports§

pub use defaults::DefaultsTable;
pub use defaults::parse_with_defaults;
pub use defaults::parse_with_defaults_and;

Modules§

claim
Whether a tool should claim the work it is closing.
date
Shared calendar date range parsing for CLI tools.
defaults
Flag defaults from the tool’s config file.

Macros§

banner
The --help header: the tool’s name and version!.
version
The version a tool shows: the git describe --tags --dirty --always of the checkout it was built from (v0.22.0-74-ge11cff1-dirty), recorded by sandogasa_build::emit_git_describe in its build.rs; the crate version when there was no checkout. Expands in the tool’s crate, which is where the build script’s variable lives. Use it as clap’s version, so -V and --version both show it; the man pages keep the plain crate version (man::check takes it).

Constants§

ALLOW_INSECURE_URL_ENV
Environment variable that, when set to a non-empty value, disables ensure_secure_url’s plaintext-credential guard. Intended for local testing against http:// mock servers or a trusted internal proxy — never for production credentials.

Functions§

confirm
Ask a yes/no question on stderr (keeping stdout clean for piped or --json output) and read one line from stdin.
ensure_secure_url
Refuse to hand credentials to a base URL that would transmit them in cleartext.
init
Standard process-wide initialization for sandogasa tools.
install_crypto_provider
Install the ring-based rustls CryptoProvider as the process default.
require_tools
Check that a batch of external tools is available, returning a single error that lists every missing one with its install hint.
tool_exists
Whether an executable named name is on $PATH (a lightweight check that does not run the tool).
wrap_prefixed
Word-wrap text to width columns and prefix every line with prefix (e.g. "> " for a Markdown blockquote, or the leading indent of a wrapped list item). Collapses runs of whitespace and never splits a word, so a single token longer than the width — a URL, typically — overflows rather than being broken. Such a token also stays on the line it started on: breaking before a word that won’t fit on a fresh line either would only orphan whatever label introduces it (LINK:, Minutes:) while still overflowing.