cmd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2016 License: MIT Imports: 35 Imported by: 0

Documentation

Overview

Package cmd contains all of the Arigato cli commands

Index

Constants

This section is empty.

Variables

View Source
var (
	StdOrgFlag      = OrgFlag("Use this organization.", true)
	StdProjectFlag  = ProjectFlag("Use this project.", true)
	StdEnvFlag      = EnvFlag("Use this environment.", true)
	StdServiceFlag  = ServiceFlag("Use this service.", "", true)
	StdUserFlag     = UserFlag("Use this user.", true)
	StdInstanceFlag = InstanceFlag("Use this instance.", true)
)

Standard flags for path expression parts.

View Source
var Cmds []cli.Command

Cmds is the list of all cli commands

Functions

func Chain

func Chain(funcs ...func(*cli.Context) error) func(*cli.Context) error

Chain allows easy sequential calling of BeforeFuncs and AfterFuncs. Chain will exit on the first error seen. XXX Chain is only public while we need it for passthrough.go

func EmailPrompt

func EmailPrompt(defaultValue string) (string, error)

EmailPrompt prompts the user to input an email

func EnsureDaemon

func EnsureDaemon(ctx *cli.Context) error

EnsureDaemon ensures that the daemon is running, and is the correct version, before a command is exeucted. the daemon will be started/restarted once, to try and launch the latest version. XXX EnsureDaemon is only public while we need it for passthrough.go

func EnsureSession

func EnsureSession(ctx *cli.Context) error

EnsureSession ensures that the user is logged in with the daemon and has a valid session. If not, it will attempt to log the user in via environment variables. If they do not exist, of the login fails, it will abort the command. XXX EnsureSession is only public while we need it for passthrough.go

func EnvFlag

func EnvFlag(usage string, required bool) cli.Flag

EnvFlag creates a new --environment cli.Flag with custom usage string.

func FullNamePrompt

func FullNamePrompt() (string, error)

FullNamePrompt prompts the user to input a person's name

func InstanceFlag

func InstanceFlag(usage string, required bool) cli.Flag

InstanceFlag creates a new --instance cli.Flag with custom usage string.

func InviteCodePrompt

func InviteCodePrompt(defaultValue string) (string, error)

InviteCodePrompt prompts the user to input an invite code

func LoadDirPrefs

func LoadDirPrefs(ctx *cli.Context) error

LoadDirPrefs loads argument values from the .arigato.json file XXX LoadDirPrefs is only public while we need it for passthrough.go

func LoadPrefDefaults

func LoadPrefDefaults(ctx *cli.Context) error

LoadPrefDefaults loads default argument values from the .arigatorc preferences file defaults section, inserting them into any unset flag values XXX LoadPrefDefaults is only public while we need it for passthrough.go

func NamePrompt

func NamePrompt(override *string, defaultValue string) (string, error)

NamePrompt prompts the user to input a person's name

func OrgFlag

func OrgFlag(usage string, required bool) cli.Flag

OrgFlag creates a new --org cli.Flag with custom usage string.

func PasswordPrompt

func PasswordPrompt(shouldConfirm bool) (string, error)

PasswordPrompt prompts the user to input a password value

func ProjectFlag

func ProjectFlag(usage string, required bool) cli.Flag

ProjectFlag creates a new --project cli.Flag with custom usage string.

func SelectAcceptAction

func SelectAcceptAction() (int, string, error)

SelectAcceptAction prompts the user to select an org from a list, or enter a new name

func SelectCreateOrg

func SelectCreateOrg(client *api.Client, c context.Context, name string) (*api.OrgResult, string, bool, error)

SelectCreateOrg prompts the user to select an org from at list of orgs populated via api request.

The user may select to create a new org, or they may preselect an org via a non-empty name parameter.

It returns the object of the selected org (if created a new org was not chosed), the name of the selected org, and a boolean indicating if a new org should be created.

func SelectCreateProject

func SelectCreateProject(client *api.Client, c context.Context, orgID *identity.ID, name string) (*api.ProjectResult, string, bool, error)

SelectCreateProject prompts the user to select a project from at list of projects populated via api request.

The user may select to create a new project, or they may preselect an project via a non-empty name parameter.

It returns the object of the selected project (if created a new project was not chosed), the name of the selected project, and a boolean indicating if a new project should be created.

func SelectOrgPrompt

func SelectOrgPrompt(orgs []api.OrgResult) (int, string, error)

SelectOrgPrompt prompts the user to select an org from a list, or enter a new name

func SelectProjectPrompt

func SelectProjectPrompt(projects []api.ProjectResult) (int, string, error)

SelectProjectPrompt prompts the user to select an org from a list, or enter a new name

func ServiceFlag

func ServiceFlag(usage, value string, required bool) cli.Flag

ServiceFlag creates a new --service cli.Flag with custom usage string.

func SetUserEnv

func SetUserEnv(ctx *cli.Context) error

SetUserEnv populates the env argument, if present and unset, with dev-USERNAME XXX SetUserEnv is only public while we need it for passthrough.go

func UserFlag

func UserFlag(usage string, required bool) cli.Flag

UserFlag creates a new --user cli.Flag with custom usage string.

func UsernamePrompt

func UsernamePrompt() (string, error)

UsernamePrompt prompts the user to input a person's name

func VersionLookup

func VersionLookup(ctx *cli.Context) error

VersionLookup ensures the environment is ready and then executes version cmd

Types

This section is empty.

Jump to

Keyboard shortcuts

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