Documentation
¶
Overview ¶
Package shell provides gbash's project-owned shell core plus the in-tree parser, expansion, and interpreter packages it executes against.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsExitStatus ¶
func IsUserSyntaxError ¶ added in v0.0.20
IsUserSyntaxError reports whether err is a user-facing shell syntax error suitable for REPL and fuzz-test classification.
Types ¶
type Execution ¶
type Execution struct {
Name string
Interpreter string
PassthroughArgs []string
ScriptPath string
Script string
Command []string
Args []string
StartupOptions []string
StartupHome string
Interactive bool
Env map[string]string
Dir string
VisiblePWD string
HasVisiblePWD bool
BuiltinCommandDir string
CompletionState *shellstate.CompletionState
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
FS gbfs.FileSystem
Network network.Client
Registry commands.CommandRegistry
Policy policy.Policy
Trace trace.Recorder
Exec func(context.Context, *commands.ExecutionRequest) (*commands.ExecutionResult, error)
Interact func(context.Context, *commands.InteractiveRequest) (*commands.InteractiveResult, error)
// contains filtered or unexported fields
}
type InteractiveParser ¶ added in v0.0.20
type InteractiveParser struct {
// contains filtered or unexported fields
}
InteractiveParser is the shell-owned frontend helper for interactive parsing. It assembles complete script chunks for REPL-style callers, but it does not execute them or provide a second shell engine.
func NewInteractiveParser ¶ added in v0.0.20
func NewInteractiveParser(name string) *InteractiveParser
NewInteractiveParser builds the shell-owned parser/printer pair used by repo REPL frontends and tests.
func (*InteractiveParser) Incomplete ¶ added in v0.0.20
func (p *InteractiveParser) Incomplete() bool
Incomplete reports whether the most recent interactive parse needs a continuation line.
type InteractiveResult ¶
type InteractiveResult struct {
ExitCode int
}
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package expand contains code to perform various shell expansions.
|
Package expand contains code to perform various shell expansions. |
|
Package fileutil allows inspecting shell files, such as detecting whether a file may be shell or extracting its shebang.
|
Package fileutil allows inspecting shell files, such as detecting whether a file may be shell or extracting its shebang. |
|
Package interp implements an interpreter to execute shell programs parsed by the syntax package.
|
Package interp implements an interpreter to execute shell programs parsed by the syntax package. |
|
Package pattern allows working with shell pattern matching notation, also known as wildcards or globbing.
|
Package pattern allows working with shell pattern matching notation, also known as wildcards or globbing. |
|
Package syntax implements parsing and formatting of shell programs.
|
Package syntax implements parsing and formatting of shell programs. |
|
typedjson
Package typedjson allows encoding and decoding shell syntax trees as JSON.
|
Package typedjson allows encoding and decoding shell syntax trees as JSON. |