cmd

package
v0.0.0-...-301f354 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 18 Imported by: 1 module, 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

Index

Constants

View Source
const (
	ExitFsck    = 1
	ExitGeneric = 3
)

Exit codes. 0, 1 and 2 keep their meaning for `ready` (found, nothing left, blocked); `fsck` also uses 1 for "problems found". Every other failure (bad id, missing directory, corrupt tickets, usage errors) exits ExitGeneric.

View Source
const DefaultDir = ".tickets"

DefaultDir is the tickets directory used when --dir is not given.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute runs the root command and exits the process with the right code.

func ReadText

func ReadText(stdin io.Reader, inline string, hasInline bool, file string) (string, error)

ReadText implements the free-form text contract shared by new and note: the text is given inline, read from stdin when inline is "-", or read from the file named by file. Giving both inline text and a file is an error. hasInline distinguishes an absent value from an empty one.

Types

type App

type App struct {
	Dir string // tickets directory (--dir)
}

App carries state shared by all commands for one invocation.

func (*App) LoadResolved

func (a *App) LoadResolved(partials ...string) (*tree.Tree, []string, error)

LoadResolved loads the tree and resolves each partial id, in order.

func (*App) LoadTree

func (a *App) LoadTree() (*tree.Tree, error)

LoadTree loads the tree, with a friendly error if the directory is missing.

func (*App) Lock

func (a *App) Lock(exclusive bool) (func(), error)

Lock locks the tickets directory and returns the release function. A missing directory is created for an exclusive lock (`new` initializes it anyway) and skipped for a shared one, so read-only commands keep their friendly "no tickets directory" error.

func (*App) Store

func (a *App) Store() *store.Store

Store returns the store for the --dir directory.

type ExitError

type ExitError struct {
	Code int
	Msg  string
}

ExitError makes a command finish with a specific exit code. An empty Msg means the command already printed everything it wanted to.

func (*ExitError) Error

func (e *ExitError) Error() string

Jump to

Keyboard shortcuts

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