cmd

package
v2.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:               "pow",
	Short:             "A client for storage and retreival of powergate data",
	Long:              `A client for storage and retreival of powergate data`,
	DisableAutoGenTag: true,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		err := viper.BindPFlag("serverAddress", cmd.Root().PersistentFlags().Lookup("serverAddress"))
		c.CheckErr(err)

		target := viper.GetString("serverAddress")

		c.PowClient, err = client.NewClient(target)
		c.CheckErr(err)
	},
	Run: func(cmd *cobra.Command, args []string) {
		v, err := cmd.Flags().GetBool("version")
		c.CheckErr(err)
		if v {
			version.Cmd.Run(cmd, args)
		} else {
			err := cmd.Help()
			c.CheckErr(err)
		}
	},
}

Cmd is the command.

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