config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigFilePath

func GetConfigFilePath(file string) (string, error)

GetConfigFilePath gets the full path to the given config file name.

func SaveConfig added in v1.0.0

func SaveConfig(conf *Config) error

func SplitQuotedFields added in v1.0.0

func SplitQuotedFields(in string, quote rune) []string

Like strings.Fields but ignores spaces inside areas surrounded by the specified quote character. To specify a single quote use backslash to escape it: '\”

Types

type Config

type Config struct {
	// Commands aliases.
	Aliases map[string][]string `yaml:"aliases"`
	// Source code path substitution rules.
	SubstitutePath SubstitutePathRules `yaml:"substitute-path"`

	// MaxStringLen is the maximum string length that the commands print,
	// locals, args and vars should read (in verbose mode).
	MaxStringLen *int `yaml:"max-string-len,omitempty"`
	// MaxArrayValues is the maximum number of array items that the commands
	// print, locals, args and vars should read (in verbose mode).
	MaxArrayValues *int `yaml:"max-array-values,omitempty"`

	// If ShowLocationExpr is true whatis will print the DWARF location
	// expression for its argument.
	ShowLocationExpr bool `yaml:"show-location-expr"`
}

Config defines all configuration options available to be set through the config file.

func LoadConfig

func LoadConfig() *Config

LoadConfig attempts to populate a Config object from the config.yml file.

type SubstitutePathRule

type SubstitutePathRule struct {
	// Directory path will be substituted if it matches `From`.
	From string
	// Path to which substitution is performed.
	To string
}

Describes a rule for substitution of path to source code file.

type SubstitutePathRules

type SubstitutePathRules []SubstitutePathRule

Slice of source code path substitution rules.

Jump to

Keyboard shortcuts

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