shellwrap

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package shellwrap holds the self-path resolution and POSIX shell quoting helpers shared by every harness adapter that wraps a command through `ctxcop run -- bash -c '<quoted>'`. Extracted from internal/harness/claudecode so the aider adapter (which builds its wrap at install time instead of hook time) doesn't duplicate it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Quote

func Quote(s string) string

Quote returns s as a single POSIX shell word, single-quoting only when necessary.

func SelfPath

func SelfPath() string

SelfPath returns the absolute path of the running binary, falling back to "ctxcop" on resolution failure.

func Unquote

func Unquote(s string) (string, bool)

Unquote reverses Quote: given a string that Quote could have produced (either a bare unquoted word, or one or more single-quoted segments joined by the POSIX `'\”` escape), it returns the original value and true. It returns false if s is not fully consumed by a single shell word — no trailing content is tolerated, so a wrap can't be spoofed by appending unwrapped commands after a legitimate-looking quoted argument.

Types

This section is empty.

Jump to

Keyboard shortcuts

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