shellparse

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redirection

type Redirection struct {
	Raw       string
	SafeFDDup bool
}

Redirection is a shell redirection operator seen outside quotes.

type Segment

type Segment struct {
	Text            string
	Normalized      string
	Separator       string
	Argv            []string
	Redirections    []Redirection
	UnsafeExpansion bool
}

Segment is one shell command segment split on control operators.

func Parse

func Parse(command string) ([]Segment, error)

Parse scans a /bin/sh-style command line into command segments. It intentionally models only the shell surface Lightcode needs for permission checks: command boundaries, argv normalization, substitutions, expansions, and redirection operators.

Jump to

Keyboard shortcuts

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