authelia/internal/commands/build-info.go
James Elliott a7e867a699
feat(configuration): replace viper with koanf (#2053)
This commit replaces github.com/spf13/viper with github.com/knadh/koanf. Koanf is very similar library to viper, with less dependencies and several quality of life differences. This also allows most config options to be defined by ENV. Lastly it also enables the use of split configuration files which can be configured by setting the --config flag multiple times.

Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
2021-08-03 19:55:21 +10:00

30 lines
633 B
Go

package commands
import (
"fmt"
"runtime"
"github.com/spf13/cobra"
"github.com/authelia/authelia/internal/utils"
)
func newBuildInfoCmd() (cmd *cobra.Command) {
cmd = &cobra.Command{
Use: "build-info",
Short: "Show the build information of Authelia",
Long: buildLong,
RunE: cmdBuildInfoRunE,
Args: cobra.NoArgs,
}
return cmd
}
func cmdBuildInfoRunE(_ *cobra.Command, _ []string) (err error) {
_, err = fmt.Printf(fmtAutheliaBuild, utils.BuildTag, utils.BuildState, utils.BuildBranch, utils.BuildCommit,
utils.BuildNumber, runtime.GOOS, runtime.GOARCH, utils.BuildDate, utils.BuildExtra)
return err
}