Documentation
¶
Overview ¶
Shell interpreting command lines inside the process, starting only the programs a line names
Index ¶
Constants ¶
const Dialect = "icebath's own shell, interpreting every command line in process with no other shell underneath"
Sentence telling a model what runs its command lines
const Name = "icebath"
What prompts and tool descriptions call the shell
Variables ¶
var Builtins = builtins()
Names the interpreter handles itself, every other command starting the program of that name on PATH
Functions ¶
Types ¶
type Cmd ¶
type Cmd struct {
Line string
// Working directory, the process working directory when empty
Dir string
// KEY=VALUE pairs layered over the environment of the process
Env []string
// Standard input of the line, closed when nil
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
}
One command line to run in a fresh shell with its own streams
type Command ¶
type Command struct {
Text string
// Runs commands the line does not spell out, through substitution, eval or source
Hidden bool
}
One simple command a line runs, as written
type Options ¶
type Options struct {
// Starting directory, the process working directory when empty
Dir string
// KEY=VALUE pairs layered over the environment of the process
Env []string
}
Settings a shell starts with
type Result ¶
type Result struct {
ExitCode int
// Exit code of every stage of the last pipeline the line ran, empty when it ran none
Pipeline []int
// Command name of every stage of that pipeline, empty for a stage that was not a plain call
Commands []string
Dir string
// The line ended the shell with exit, so the next line starts a fresh one in the same directory
Exited bool
// The context ended before the line did and everything it started was killed
Killed bool
}
How a command line ended and the working directory it left behind
type Shell ¶
type Shell struct {
// contains filtered or unexported fields
}
One persistent interpreter whose variables, functions, aliases and directory carry over between lines
func (*Shell) Close ¶
func (s *Shell) Close()
Kills everything the shell started that is still running and releases it