cmd

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "unknown"
	Build   = "unknown"
	Time    = "unknown"
	Packer  = ""
)

Build number and versions injected at compile time

View Source
 _ __ | | __ _| |_ _   _ _ __  _   _ ___ 
| '_ \| |/ _` + "`" + ` | __| | | | '_ \| | | / __|
| |_) | | (_| | |_| |_| | |_) | |_| \__ \
| .__/|_|\__,_|\__|\__, | .__/ \__,_|___/
|_|                |___/|_|
`

Logo is the string that should be displayed when the program starts

View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Show build, version and build date",
	Long:  versionHelp,
	Run: func(cmd *cobra.Command, args []string) {
		packed := ""
		if Packer != "" {
			packed = fmt.Sprintf("Packer: %s\n", Packer)
		}

		fmt.Printf("Build: %s\nVersion: %s\nBuild Date: %s\n%s", Build, Version, Time, packed)
	},
}

VersionCmd is a command that will display the build number and version (if any)

Functions

func AddAllFlags

func AddAllFlags(c *cobra.Command)

AddAllFlags will add all the flags provided in this package to the provided command and will bind those flags with viper

func AddConfigurationFlag

func AddConfigurationFlag(c *cobra.Command)

AddConfigurationFlag adds support to provide a configuration file on the command line

func AddLoggerFlags

func AddLoggerFlags(c *cobra.Command)

AddLoggerFlags adds support to configure the level of the logger

func AddServerFlags

func AddServerFlags(c *cobra.Command)

AddServerFlags adds support to configure the server

func Initialize

func Initialize()

Initialize will be run when cobra finishes its initialization

Types

This section is empty.

Jump to

Keyboard shortcuts

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