Skip to main content

Module quote

Module quote 

Source
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.