shquote

package
v0.75.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package shquote quotes a string for a shell command line. lich composes several of those — the terminal-editor invocation handed to a session (internal/system), on a POSIX shell and on Windows, where the session's shell is PowerShell; and the hook, MCP and login commands it writes for providers. All of them interpolate a path or a binary name the user or an agent chose. One copy of each rule, so a metacharacter that survives one call site cannot survive the other.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Quote

func Quote(s string) string

Quote returns s single-quoted, safe against embedded single quotes. It assumes an sh/bash/zsh-style shell; PowerShell, which a Windows session runs, spells the escape differently — see QuotePwsh.

func QuotePwsh

func QuotePwsh(s string) string

QuotePwsh returns s single-quoted for PowerShell, safe against embedded single quotes. PowerShell expands nothing inside a single-quoted string — no $variable, no `backtick escape, no subexpression — so doubling the quote is the whole rule, and unlike cmd.exe (which lich no longer opens a session in) there is no character it cannot express.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL