cmd

package
v2.6.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2017 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "ttnctl",
	Short: "Control The Things Network from the command line",
	Long:  `ttnctl controls The Things Network from the command line.`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		var logLevel = log.InfoLevel
		if viper.GetBool("debug") {
			logLevel = log.DebugLevel
		}

		ctx = apex.Wrap(&log.Logger{
			Level:   logLevel,
			Handler: cliHandler.New(os.Stdout),
		})

		if viper.GetBool("debug") {
			util.PrintConfig(ctx, true)
		}

		ttnlog.Set(ctx)
		grpclog.SetLogger(grpc.Wrap(ttnlog.Get()))

		if viper.GetBool("allow-insecure") {
			api.AllowInsecureFallback = true
		}
	},
}

RootCmd is the entrypoint for ttnctl

Functions

func Execute

func Execute()

Execute runs on start

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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