Skip to content

Commit

Permalink
Merge pull request #1 from marcsauter/master
Browse files Browse the repository at this point in the history
feat: add Config.Variables to be added to kong.Vars
  • Loading branch information
zbindenren authored Aug 11, 2021
2 parents 9bee9cd + d5a8c17 commit d789a49
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions king.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type Config struct {
Description string
BuildInfo *BuildInfo
ConfigPaths []string
Variables map[string]string
FileResolver FileResolver
}

Expand All @@ -41,6 +42,10 @@ func DefaultOptions(c Config) []kong.Option {
configPathsKey: c.pathString(),
}

for k, v := range c.Variables {
vars[k] = v
}

if c.BuildInfo != nil {
vars[versionKey] = c.BuildInfo.Version(c.Name).String()

Expand Down

0 comments on commit d789a49

Please sign in to comment.