autoflag

package
v0.0.0-...-6d254d7 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2015 License: BSD-2-Clause Imports: 3 Imported by: 4

Documentation

Overview

Package autoflag provides automatic command line flags that tell gofigure where to read config files from.

Simply adding an import to:

"github.com/EverythingMe/gofigure/autoflag"

will result in the flags -conf and -confdir being added to your program's flags.

Then you can call autoflag.Load to either load the file in -conf or all files in -confdir.

Note that autoflag.Load will call flag.Parse if you haven't already parsed the flags.

Index

Constants

This section is empty.

Variables

View Source
var ConfigDir string

ConfigDir keeps the value of the -confdir flag if it was set

View Source
var ConfigFile string

ConfigFile keeps the value of the -conf flag if it was set

Functions

func Load

func Load(l *gofigure.Loader, conf interface{}) error

Load either loads the file specified in -conf or the dir in -confdir with loader l to conf

Note that if both are set, we read just the conf file and exit

Types

This section is empty.

Jump to

Keyboard shortcuts

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