args

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAndValidate

func ParseAndValidate(specs []Spec, argsKvStrs []string) (map[string]any, error)

ParseAndValidate checks that the provided arguments match the argument specifications for this TTP

**Parameters:**

specs: slice of argument Spec values loaded from the TTP yaml argKvStrs: slice of arguments in "ARG_NAME=ARG_VALUE" format

**Returns:**

map[string]string: the parsed and validated argument key-value pairs error: an error if there is a problem

Types

type Spec

type Spec struct {
	Name    string   `yaml:"name"`
	Type    string   `yaml:"type,omitempty"`
	Default string   `yaml:"default,omitempty"`
	Choices []string `yaml:"choices,omitempty"`
	Format  string   `yaml:"regexp,omitempty"`
	// contains filtered or unexported fields
}

Spec defines a CLI argument for the TTP

Jump to

Keyboard shortcuts

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