Help us shape the future of Go! Take the 2026 Go Developer Survey

commandargs

package module
v0.0.0-...-c703685 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Source: modules/fileread/read/arguments.go:14:119@7197229d.

Index

Constants

View Source
const MaxOutputTokens = 15_500

Source: internal/router/toolplugin/frontend_options.go:11:128@[e702dffa] shared command options.

View Source
const MaxTokensArgumentError = "--max-tokens requires one positive integer and cannot repeat"

Variables

View Source
var LineRangePattern = regexp.MustCompile(`^[0-9]+[:-][0-9]+$`)

LineRangePattern identifies range operands before command-specific path handling.

Functions

func ExpandMaxTokensOption

func ExpandMaxTokensOption(arguments []string) []string

Expand only the next option, never operands owned by a command or -- boundary.

func ParseLineRange

func ParseLineRange(span string) (int, int, error)

ParseLineRange parses canonical inclusive endpoints. Callers impose their own numeric ceiling; zero starts remain available for mcat's first-row convention.

func ParseMaxTokens

func ParseMaxTokens(value string) (int, error)

func ParseReadBundle

func ParseReadBundle(args []string) ([]ReadSelection, ReaderOptions, error)

ParseReadBundle validates argv without reading content; ambiguous PATH:ROW operands use filesystem metadata to preserve existing literal filenames.

func ParseReadBundleSource

func ParseReadBundleSource(args []string) ([]ReadSelection, ReaderOptions, error)

ParseReadBundleSource validates unevaluated source arguments without filesystem inspection. Ambiguous PATH:ROW operands remain unclassified, even when a literal file with that name exists. Execution uses ParseReadBundle to disambiguate them.

func Quote

func Quote(value string) string

Source: libraries/commandanalysis/shellsyntax/source.go:9:12@7197229d. Quote preserves a literal shell argument, including empty strings.

func QuoteArgument

func QuoteArgument(value string) string

QuoteArgument renders a compact Bash argument, preserving the literal fallback. Source: libraries/commandanalysis/shellsyntax/words.go:210:216@7197229d.

Types

type ReadSelection

type ReadSelection struct {
	Path       string
	Range      string
	Start, End int
}

ReadSelection is one source and its normalized inclusive range, if present.

type ReaderOptions

type ReaderOptions struct {
	Budget, Lines int
	Tail, Number  bool
}

func ParseReaderOptions

func ParseReaderOptions(args []string, allowTail bool, defaultBudget int, takesValue string) (ReaderOptions, []string, error)

ParseReaderOptions removes shared reader options and retains the -- boundary and command-specific operands, including the value of takesValue. Source: plugins/common.ts:48:99@[543de4f3] readerOptions

type RunOptions

type RunOptions struct {
	Lines  int
	Tokens int
	Tail   bool
}

RunOptions selects the bounded foreground command output.

func ParseRunOptions

func ParseRunOptions(arguments []string) (RunOptions, []string, error)

ParseRunOptions separates mrun options from the untouched child argv.

type SymbolArguments

type SymbolArguments struct {
	Queries           []SymbolQuery
	Workspace         string
	ExplicitWorkspace bool
	Budget            int
}

SymbolArguments retains ordered selectors and explicit workspace selection. Parsing does not resolve the directory or grant access to it.

func ParseSymbolQueries

func ParseSymbolQueries(args []string) (SymbolArguments, error)

ParseSymbolQueries validates a complete msymbol invocation without reading sources or starting a resolver. Execution and source display share this grammar.

type SymbolQuery

type SymbolQuery struct {
	Mode, Path, Name string
	Line, Occurrence int
}

SymbolQuery selects one semantic definition or reference lookup.

Jump to

Keyboard shortcuts

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