specs

package
v0.0.0-...-0657d2b Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Name        string    `yaml:"name"`
	Usage       string    `yaml:"usage"`
	Action      string    `yaml:"action"`
	Flags       []Flag    `yaml:"flags"`
	SubCommands []Command `yaml:"commands"`
}

type ExitCode

type ExitCode struct {
	Message string `yaml:"message"`
	Code    int    `yaml:"code"`
}

type Flag

type Flag struct {
	Name    string   `yaml:"name"`
	Value   string   `yaml:"value"`
	Type    string   `yaml:"type"`
	Usage   string   `yaml:"usage"`
	Aliases []string `yaml:"aliases"`
	EnvVars []string `yaml:"envVars"`
}

type Root

type Root struct {
	Name                   string              `yaml:"name"`
	Version                string              `yaml:"version"`
	VersionFlag            Flag                `yaml:"versionFlag"`
	Copyright              string              `yaml:"copyright"`
	Usage                  string              `yaml:"usage"`
	UsageText              string              `yaml:"usageText"`
	Action                 string              `yaml:"action"`
	Flags                  []Flag              `yaml:"flags"`
	UseShortOptionHandling bool                `yaml:"useShortOptionHandling"`
	EnableBashCompletion   bool                `yaml:"enableBashCompletion"`
	Commands               []Command           `yaml:"commands"`
	ExitCodes              map[string]ExitCode `yaml:"exitCodes"`
}

func Unmarshal

func Unmarshal(in []byte) (Root, error)

Jump to

Keyboard shortcuts

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