Expand description
Shell quoting utilities for command-stream
This module provides functions for safely quoting values for shell usage, preventing command injection and ensuring proper argument handling.
Functions§
- find_
split_ template_ token - Scan a built command string for an unquoted Go/Handlebars-style template
token (
{{ ... }}) that contains an unquoted space. - needs_
quoting - Check if a string needs quoting for shell usage
- quote
- Quote a value for safe shell usage
- quote_
all - Quote multiple values and join them with spaces
- warn_
on_ split_ template - Emit a one-line diagnostic when a built command contains an unquoted Go
template token with an internal space. This points users at the
shell-splitting gotcha behind the cryptic downstream errors (e.g. Go’s
“unclosed action”). Silenced via
COMMAND_STREAM_NO_TEMPLATE_WARNING, and each unique snippet is only reported once per process.