line

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package line orchestrates execution of a single REPL input line.

It defines the command's Config (the injected filesystem and home directory) and Run (the orchestration entry point the app tier invokes). Run tokenizes the line, expands each segment's arguments, resolves and builds each segment against the command registry, and plans the assembled pipeline — delegating every step to the reusable internal/token, internal/expansion, internal/flags, internal/command, and internal/pipeline packages. It contains no tokenizing, flag-parsing, or stream-running logic of its own. It is the orchestration seam between the app tier (internal/app) and the implementation packages.

Run returns the planned internal/pipeline.Assembly rather than running it: the app tier "renders" that result by streaming it to the session's output writer, mirroring how a gomatic/template.cli domain returns a Result the app renders.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg Config, stdin io.Reader, in token.Line) (pipeline.Assembly, error)

Run resolves the input line into a planned pipeline: it tokenizes the line, builds each segment against the command registry, and folds the stages into a pipeline.Assembly the caller streams to its output. It holds no presentation or stream-running logic.

Types

type Config

type Config struct {
	Fs   afero.Fs
	Home expansion.Home
}

Config holds the injected collaborators a line needs to be resolved and planned: the filesystem (for glob matching, file sources, and ls/find construction) and the home directory (for "~" expansion). Both are injected so resolution stays testable against an in-memory afero.Fs. It carries data only, no behavior.

There is no domain-local types.go: Fs reuses afero.Fs and Home reuses expansion.Home, so there are no bare primitives to name.

Jump to

Keyboard shortcuts

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