cmd

package
v0.0.0-...-ee66dcd Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2017 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const APPID = "com.github.jsurloppe.fbxcli"
View Source
const APPNAME = "fbxcli"
View Source
const APPVERSION = "0"

Variables

View Source
var App = &fbxapi.App{
	AppID:      APPID,
	AppVersion: APPVERSION,
}
View Source
var ENV struct {
	CfgFile      string
	FreeboxsList map[string]*fbxapi.Freebox
	CurrentAlias string
	Cwd          map[string]string
}
View Source
var RootCmd = &cobra.Command{
	Use:   "fbx",
	Short: "fbx is a freebox command line utility",
	Long:  "A (non+)interactive cli for managing your currentFreebox",
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		defer panicHandler()

		alias, _ := cmd.Flags().GetString("freebox")
		if alias == "" {
			alias = getDefaultFreebox()
		}
		if alias != "" {
			err := connect(alias)
			checkErr(err)
		}
	},

	PersistentPostRun: func(cmd *cobra.Command, args []string) {
		PoolLogout()
		updateConfig()
	},
}
View Source
var ShellCmd = &cobra.Command{
	Use:   "shell",
	Short: "fbx is a freebox command line utility",
	Long:  "A (non+)interactive cli for managing your currentFreebox",
	Run: func(cmd *cobra.Command, args []string) {
		shell(cmd, args)
	},
	PostRun: func(cmd *cobra.Command, args []string) {
		rlshell.Close()
	},
}

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 NewClient

func NewClient(alias string) (client *fbxapi.Client, err error)

func PoolLogout

func PoolLogout()

func Register

func Register(alias string, freebox *fbxapi.Freebox) (client *fbxapi.Client, track_id int, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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