Add configuration loading + docs + linter fixes.

This commit is contained in:
Alec Thomas
2018-06-13 10:33:22 +10:00
parent a5c97373ba
commit 232faad0a0
15 changed files with 218 additions and 17 deletions
+3
View File
@@ -19,6 +19,7 @@ func Parse(cli interface{}, options ...Option) string {
return cmd
}
// FatalIfErrorf terminates with an error message if err != nil.
func FatalIfErrorf(err error, args ...interface{}) {
if App == nil {
panic("call kong.Parse() before using kong.FatalIfErrorf()")
@@ -26,6 +27,7 @@ func FatalIfErrorf(err error, args ...interface{}) {
App.FatalIfErrorf(err, args...)
}
// Errorf writes a message to Kong.Stderr with the application name prefixed.
func Errorf(format string, args ...interface{}) {
if App == nil {
panic("call kong.Parse() before using kong.Errorf()")
@@ -33,6 +35,7 @@ func Errorf(format string, args ...interface{}) {
App.Errorf(format, args...)
}
// Printf writes a message to Kong.Stdout with the application name prefixed.
func Printf(format string, args ...interface{}) {
if App == nil {
panic("call kong.Parse() before using kong.Printf()")