toml

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: MIT Imports: 2 Imported by: 0

README

toml GoDoc

TOML Source and Extractor for flagga.

Install

go get -v github.com/erizocosmico/flaggax/toml

Usage


import (
    "github.com/erizocosmico/flagga"
    "github.com/erizocosmico/flaggax/toml"
)

//...

var fs flagga.FlagSet

db := fs.String("db", defaultDBURI, "database connection string", toml.Key("db_uri"))
users := fs.StringList("users", nil, "list of allowed users", toml.Key("users"))

err := fs.Parse(os.Args[1:], toml.Via("config.toml"))
if err != nil {
    // handle err
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(key string) flagga.Extractor

Key returns an Extractor that will match the given key in a provided TOML file to set as value for the flag.

func Via

func Via(file string) flagga.Source

Via returns a Source that will use a TOML file as a provider of flag values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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