shellquote

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 3 Imported by: 0

README

shellquote

Shell argument quoting and prompt-file helpers for command templates.

Install

go get github.com/brandonkramer/shellquote

Usage

cmd := shellquote.SubstitutePrompt("cat {prompt}", "/tmp/run/prompt.md")
path, err := shellquote.WritePrompt(runDir, promptContent)

Documentation

Overview

Package shellquote provides shell argument quoting and prompt-file helpers.

Index

Constants

View Source
const (
	// DefaultPromptFile is the default prompt filename under a run directory.
	DefaultPromptFile = "prompt.md"
	// PromptPlaceholder is substituted with a quoted prompt path in templates.
	PromptPlaceholder = "{prompt}"
)

Variables

This section is empty.

Functions

func PromptPath

func PromptPath(runDir string) string

PromptPath returns the default prompt file path under runDir.

func Quote

func Quote(s string) string

Quote wraps s in single quotes for POSIX shells.

func SubstitutePrompt

func SubstitutePrompt(template, promptPath string) string

SubstitutePrompt replaces PromptPlaceholder with a quoted promptPath in template.

func WritePrompt

func WritePrompt(runDir, content string) (string, error)

WritePrompt writes content to the default prompt file under runDir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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