cmd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Promu = &cobra.Command{
	Use:           "promu",
	Short:         "promu is the utility tool for Prometheus projects",
	Long:          `promu is the utility tool for Prometheus projects`,
	SilenceErrors: true,
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		var err error
		info, err = NewProjectInfo()
		if err != nil {
			return err
		}
		return initConfig()
	},
	Run: func(cmd *cobra.Command, args []string) {
		cmd.Help()
	},
}

Promu represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func RepoPathFunc

func RepoPathFunc() interface{}

RepoPathFunc returns the repository path.

func UserFunc

func UserFunc() (interface{}, error)

UserFunc returns the current username.

Types

type Binary

type Binary struct {
	Name string
	Path string
}

Binary represents a built binary.

type ProjectInfo

type ProjectInfo struct {
	Branch   string
	Name     string
	Owner    string
	Repo     string
	Revision string
	Version  string
}

ProjectInfo represents current project useful informations.

func NewProjectInfo

func NewProjectInfo() (ProjectInfo, error)

NewProjectInfo returns a new ProjectInfo.

Jump to

Keyboard shortcuts

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