version

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Commit    = ""
	Version   = ""
	GoSumHash = ""
	BuildTags = ""
)
View Source
var (
	VersionCmd = &cobra.Command{
		Use:   "version",
		Short: "Print the app version",
		RunE: func(_ *cobra.Command, _ []string) error {
			verInfo := newVersionInfo()

			if !viper.GetBool(flagLong) {
				fmt.Println(verInfo.DecentRandom)
				return nil
			}

			if viper.GetString(cli.OutputFlag) != "json" {
				fmt.Print(verInfo)
				return nil
			}

			bz, err := json.Marshal(verInfo)
			if err != nil {
				return err
			}
			fmt.Println(string(bz))
			return nil
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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