cli

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Add = cmd.Sub{
	Name:  "add",
	Alias: "a",
	Short: "Add an entry to the database",
	Args:  &AddArgs{},
	Run:   AddRun,
}

Add imports a new app entry into the database.

View Source
var AddDep = cmd.Sub{
	Name:  "add-dependency",
	Alias: "ad",
	Short: "Add an entry, dependency relationship to the database",
	Args:  &AddDepArgs{},
	Run:   AddDepRun,
}

AddDep imports a new app, dependency relationship into the database.

View Source
var Import = cmd.Sub{
	Name:  "import",
	Alias: "im",
	Short: "Import a package in .yml format to the database.",
	Args:  &ImportArgs{},
	Run:   ImportRun,
}

Import adds a new app to the database.

View Source
var Info = cmd.Sub{
	Name:  "info",
	Alias: "in",
	Short: "Displays the information for a package in the database",
	Args:  &InfoArgs{},
	Run:   InfoRun,
}

Info gets an entry from the database and displays the relevant information.

View Source
var List = cmd.Sub{
	Name:  "list",
	Alias: "ls",
	Short: "List all of the applications in the database.",
	Args:  &ListArgs{},
	Run:   ListRun,
}

List shows all the apps in the database.

View Source
var Remove = cmd.Sub{
	Name:  "remove",
	Alias: "rm",
	Short: "Remove an entry from the database.",
	Args:  &RemoveArgs{},
	Run:   RemoveRun,
}

Remove deletes an entry from the application database.

View Source
var RemoveDep = cmd.Sub{
	Name:  "remove-dependency",
	Alias: "rd",
	Short: "Remove an entry, dependency relationship from the database.",
	Args:  &RemoveDepArgs{},
	Run:   RemoveDepRun,
}

RemoveDep deletes an app, dependency relationship from the database.

View Source
var Root *cmd.Root

Root is the main command.

View Source
var Run = cmd.Sub{
	Name:  "run",
	Alias: "r",
	Short: "Run a full scan of the database to check for updates.",
	Args:  &RunArgs{},
	Run:   RunFull,
}

Run executes a full database scan to see if any applictions are out of date.

View Source
var SelfUpdate = cmd.Sub{
	Name:  "self-update",
	Alias: "ups",
	Short: "Have lookout update itself to the lastest version.",
	Args:  &SelfUpdateArgs{},
	Flags: &SelfUpdateFlags{},
	Run:   UpdateRun,
}

SelfUpdate checks for a new version of Lookout and updates itself if a newer version is found and the user agrees to update.

View Source
var Spinner = []string{"|", "/", "-", "\\"}

Spinner is an array of the progression of the spinner.

View Source
var Upgrade = cmd.Sub{
	Name:  "upgrade",
	Alias: "up",
	Short: "Set an entry to the latest version possible.",
	Args:  &UpgradeArgs{},
	Run:   UpgradeRun,
}

Upgrade modifies an entry in the database to make it the latest version.

Functions

func AddDepRun

func AddDepRun(r *cmd.Root, c *cmd.Sub)

AddDepRun imports a new app, dependency relationship. It will also check for duplicate dependencies before continuing.

func AddRun

func AddRun(r *cmd.Root, c *cmd.Sub)

AddRun imports a new app entry into the database. Will also check if the application is up-to-date before entering into the database.

func ImportRun

func ImportRun(r *cmd.Root, c *cmd.Sub)

ImportRun adds a new app entry to the database by parsing a YAML file. Import like the add command will check if the app is up to date before adding to the database.

func InfoRun

func InfoRun(r *cmd.Root, c *cmd.Sub)

InfoRun searched the database and displays the information.

func ListRun

func ListRun(r *cmd.Root, c *cmd.Sub)

ListRun searches the database and lists all apps in it.

func RemoveDepRun

func RemoveDepRun(r *cmd.Root, c *cmd.Sub)

RemoveDepRun deletes an app, dependency relationship from the database.

func RemoveRun

func RemoveRun(r *cmd.Root, c *cmd.Sub)

RemoveRun executes a remove statments from the SQL database.

func RunFull

func RunFull(r *cmd.Root, c *cmd.Sub)

RunFull creates all nessisary go routines for the scan to run.

func SpinnerWait added in v1.2.0

func SpinnerWait(done chan int, message string, wg *sync.WaitGroup)

SpinnerWait displays the actual spinner

func UpdateRun added in v1.2.0

func UpdateRun(r *cmd.Root, c *cmd.Sub)

UpdateRun handles the checking and self updating of Lookout.

func UpgradeRun

func UpgradeRun(r *cmd.Root, c *cmd.Sub)

UpgradeRun will patch an existing database entry with the latest information.

Types

type AddArgs

type AddArgs struct {
	ID      string
	Version string
	URL     string
}

AddArgs handles the specifc arguments for the add command.

type AddDepArgs

type AddDepArgs struct {
	ID  string
	Dep string
}

AddDepArgs handles the specific arguments for the AddDep command.

type GlobalFlags

type GlobalFlags struct{}

GlobalFlags contains the flags for commands.

type ImportArgs

type ImportArgs struct {
	Filename string
}

ImportArgs handles the specific arguments for the import command.

type InfoArgs

type InfoArgs struct {
	ID string
}

InfoArgs handles the search specific arguments passed to the command.

type ListArgs

type ListArgs struct {
}

ListArgs handles the specific arguments passed to list. For real though its a place holder.

type RemoveArgs

type RemoveArgs struct {
	ID string
}

RemoveArgs handles the arguments passed to the remove command.

type RemoveDepArgs

type RemoveDepArgs struct {
	ID  string
	Dep string
}

RemoveDepArgs handles the specific arguments for the RemoveDep command.

type RunArgs

type RunArgs struct {
}

RunArgs handles arguments passed to the run command.

type SelfUpdateArgs added in v1.2.0

type SelfUpdateArgs struct {
}

SelfUpdateArgs handles the specific arguments for the update command.

type SelfUpdateFlags added in v1.2.0

type SelfUpdateFlags struct {
	Yes bool `short:"y" long:"yes" desc:"If a newer version is found update without prompting the user."`
}

SelfUpdateFlags handles the specific flags for the update command.

type UpgradeArgs

type UpgradeArgs struct {
	ID string
}

UpgradeArgs handles the specific arguments for the upgrade command.

Jump to

Keyboard shortcuts

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