notation

package
v0.71.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package notation is how f10 start's command line spells an entry: <task>[-suffix][@<base>...][:profile], a bundle's tasks joined by +, and a comma stacking an entry on the one before it. The parser and the proposal's printer both go through it, so the two cannot drift. It reads nothing.

Index

Constants

View Source
const (
	Bundle  = "+" // joins a bundle's tasks, lead first
	Chain   = "," // stacks an entry on the one before it
	Base    = "@" // names one base
	Profile = ":" // opens the agent profile, which comes last
)

The marks of the notation.

Variables

This section is empty.

Functions

func Format

func Format(e Entry) string

Format spells one entry, every base as an @.

func FormatChain

func FormatChain(entries []Entry) string

FormatChain spells entries as one token, each stacked on the one before it. The comma says that base, so an entry's first base is left out when it is the entry before it, and Parse puts it back.

func IsID

func IsID(word string) bool

IsID says whether word is shaped as a task f10 start takes: `ABC-12` or a bare number with an optional -suffix, or a bundle of them. The shape is enough where a caller resolves each id against the project later.

func IsURL

func IsURL(token string) bool

IsURL reports a token that is a url, which no mark splits.

func JoinSuffix

func JoinSuffix(id, suffix string) string

JoinSuffix is SplitSuffix's inverse: id salted with suffix, or id alone with none.

func Ordered

func Ordered(entries []Entry) bool

Ordered reports a typed base on any entry.

func SplitProfile

func SplitProfile(tok string) (string, string, error)

SplitProfile cuts a task token's :profile off: the first colon whose remainder holds no slash, so `FT-1:claude:opus:high` splits after the id, and a url's scheme and port stay part of the task.

func SplitSuffix

func SplitSuffix(token string) (string, string)

SplitSuffix separates a salted reference into the reference and its suffix. A token without one, or a url, comes back whole with "".

Types

type Entry

type Entry struct {
	// Task is the task as typed, its -suffix kept: `A-1`, `A-1-x`, `A-1+A-2`
	// or a url. It is kept whole because a batch's record is keyed on the
	// command line as typed.
	Task    string
	Bases   []string // each base as typed: the entry before it in a chain, then each @
	Profile string
}

An Entry is one task or bundle of the command line.

func Parse

func Parse(tok string) ([]Entry, error)

Parse reads one command-line token as a chain of entries. A comma stacks an entry on the one before it, and each @ names one more base. A url is one entry taken whole, because its path or query may hold either mark.

func (Entry) ID

func (e Entry) ID() string

ID is the entry without its suffix: what another entry names as its base.

func (Entry) Members

func (e Entry) Members() []string

Members is each task of the entry, lead first, the lead's suffix cut off.

func (Entry) Suffix

func (e Entry) Suffix() string

Suffix is the entry's -suffix, "" for none. A bundle takes none.

Jump to

Keyboard shortcuts

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