Help us shape the future of Go! Take the 2026 Go Developer Survey

example

command
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2014 License: Apache-2.0 Imports: 2 Imported by: 0

README

flagconfig example

This example shows how you can use flagconfig to easily parse options off either the command line or a configuration file. If you call go run main.go (assuming flagconfig is installed on your command-line) then you will see the default values for three parameters, --foo and --bar and --baz. You can use -h to see all options.

--example

flagconfig can read the configuration from a configuration file. These files have a very simple syntax that you'll be able to easily pick up at a glance. You can use the --example flag to dump your application's example configuration to stdout (which can then be piped to a file).

--config

You can specify a configuration file for flagconfig to read in and attempt to populate the defined paramters with. If a parameter is defined on the command-line AND in a configuration file then the command-line value takes precedence. If it's not defined in either then the default value specified is used.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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