args

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package args defines the Trice command-line interface.

It owns subcommand flag sets, parses command-line arguments, and dispatches to the corresponding runtime actions (log, help, version, add, insert, clean, generate, scan, display server, and shutdown).

Handler is the package entry point used by cmd/trice.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is injected at build time (typically by goreleaser).
	Version string

	// Commit is the VCS revision hash injected at build time.
	Commit string

	// Date is the build timestamp injected at build time.
	Date string

	// Verbose enables additional informational output.
	Verbose bool

	// Branch is the Git branch name at build time.
	Branch string

	// GitState indicates repository state at build time ("clean" or "dirty").
	GitState string

	// GitStatus contains a '|' separated summary of modified files at build time.
	GitStatus string

	// BuiltBy is an optional builder identifier (see .goreleaser.yaml).
	BuiltBy string
)
View Source
var (

	// LogfileName is the filename of the logfile. "off" inhibits logfile writing.
	LogfileName = "off"
)

Functions

func FlagsInit added in v0.41.0

func FlagsInit()

FlagsInit initializes all sub-command flag sets.

func Handler

func Handler(w io.Writer, fSys *afero.Afero, args []string) error

Handler parses args and executes the selected sub-command.

args is expected in os.Args form where args[0] is the executable name and args[1] is the sub-command.

func LogHandler added in v1.2.3

func LogHandler(w io.Writer, fSys *afero.Afero, args []string) error

LogHandler parses log args and executes the log command.

args is expected in os.Args form where args[0] is the executable name and args[1:] are the log command flags. This makes `tlog ...` use the same code path as `trice log ...` without exposing the other trice sub-commands.

func RenderHelpText added in v1.2.0

func RenderHelpText(helpArgs ...string) (string, error)

RenderHelpText returns the help output for the passed help command arguments.

Types

This section is empty.

Jump to

Keyboard shortcuts

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