gowdkcmd

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MPL-2.0 Imports: 60 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitCodeFor

func ExitCodeFor(err error) int

exitCodeFor maps an error to its process exit code. Errors carrying an explicit ExitCode() (the documented gowdk audit contract) use it; every other error is a generic failure (1).

func Main

func Main()

Main runs the gowdk command-line program and exits with the documented code.

func Run

func Run(args []string) error

Run executes a gowdk command without exiting the current process.

func RunWithConfig

func RunWithConfig(args []string, config *gowdk.Config, projectRoot string) error

RunWithConfig executes a command using a native project config already loaded in the current process. It is used by generated project helpers so gowdk.Config never has to cross a process boundary.

Types

type CommandSpec added in v0.13.0

type CommandSpec struct {
	Name       string
	Handler    func([]string) error
	Usage      func() string
	ListSuffix string
	Summary    string
	Children   []CommandSpec
}

type FlagGroup added in v0.13.0

type FlagGroup struct {
	Name  string
	Flags []string
}

FlagGroup names flags shared by multiple commands. Groups are descriptive; command membership is still determined from the command's canonical usage.

type FlagSpec added in v0.13.0

type FlagSpec struct {
	Name  string
	Group string
}

FlagSpec is one completion/documentation view of a parser-owned flag. The canonical token comes from the CommandSpec usage line so help, docs, and completion cannot drift independently.

type OperationError

type OperationError struct {
	Summary     string
	Diagnostics []devOverlayDiagnostic
	Cause       error
	Code        int
}

func (*OperationError) Error

func (err *OperationError) Error() string

func (*OperationError) ExitCode

func (err *OperationError) ExitCode() int

func (*OperationError) Unwrap

func (err *OperationError) Unwrap() error

Jump to

Keyboard shortcuts

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