flags

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type YamlParser

type YamlParser struct {
	ParseAsDefaults bool // override default flags
	// contains filtered or unexported fields
}

YamlParser is an argument parser for flags package but takes a YAML file instead of a standard INI. This allows it to parse configuration directives in a more complex / hierarhical manner. While the INI file only has two levels, a YAML file can have multiple. And every level can be either a value, a map or a list.

func NewYamlParser

func NewYamlParser(p *flags.Parser) *YamlParser

NewYamlParser creates a new yaml parser for a given flags.Parser.

func (*YamlParser) ParseFile

func (y *YamlParser) ParseFile(filename string) error

ParseFile parses flags from an yaml formatted file. The returned errors can be of the type flags.Error or flags.IniError.

Jump to

Keyboard shortcuts

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