advargs

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultParser = NewParser()

DefaultParser is a convenience parser for simple use cases.

Functions

func IsActionDetails

func IsActionDetails(action string) bool

IsActionDetails returns true if action is "details" (case-insensitive).

func IsActionRun

func IsActionRun(action string) bool

IsActionRun returns true if action is "run" or empty (case-insensitive).

func IsModeShuffle

func IsModeShuffle(mode string) bool

IsModeShuffle returns true if mode is "shuffle" (case-insensitive).

func Parse

func Parse(raw map[string]string, dest any, ctx *ParseContext) error

Parse is a convenience function using the default parser.

func ShouldRun

func ShouldRun(g zapscript.GlobalArgs) bool

ShouldRun returns true if the command should execute based on the When condition.

Types

type ParseContext

type ParseContext struct {
	LauncherIDs []string
}

ParseContext provides runtime context for validation.

func NewParseContext

func NewParseContext(launcherIDs []string) *ParseContext

NewParseContext creates a ParseContext from a list of launcher IDs.

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser handles parsing and validation of advanced arguments.

func NewParser

func NewParser() *Parser

NewParser creates a new Parser with registered custom validators.

func (*Parser) Parse

func (p *Parser) Parse(raw map[string]string, dest any, ctx *ParseContext) error

Parse decodes raw advanced args into a typed struct and validates them. Returns an error if decoding or validation fails.

Jump to

Keyboard shortcuts

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