Documentation
¶
Index ¶
- func NewRoot(version string) *cobra.Command
- func Rewrite(args []string) []string
- type App
- func (a *App) Org(ctx context.Context) (string, error)
- func (a *App) Portal() *portal.Client
- func (a *App) Renderer() *render.Renderer
- func (a *App) Target(ctx context.Context) (Target, error)
- func (a *App) TargetForApp(ctx context.Context, name string) (Target, error)
- func (a *App) TargetToChange(ctx context.Context) (Target, error)
- type ExitCode
- type Global
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
Version string
Global Global
Config *config.Config
Out io.Writer
// Err takes notes that are not the command's output; stderr when nil.
Err io.Writer
// ProjectOrg is the org named by a config file in the working directory.
ProjectOrg string
// ProjectProject is the project named by that same file.
ProjectProject string
// ProjectEnvironment is the environment named by that same file.
ProjectEnvironment string
// contains filtered or unexported fields
}
App is the state shared by every command in the tree.
func (*App) Org ¶
Org resolves the organization a command runs against. With nothing selected, an account that belongs to exactly one organization has nothing to choose, so pick it rather than demand a step.
func (*App) Target ¶ added in v0.5.0
Target resolves the organization, project and environment a command that only reads runs against. An org with one reachable project has nothing to choose, and no environment chosen is the organization's default, never an error: when that default cannot be read it is development, said once on stderr. When org or project is missing, the returned Target still carries what was chosen: a project or environment that was asked for is not lost because no org resolved.
func (*App) TargetForApp ¶ added in v0.5.0
TargetForApp is Target for a named app: with no organization or project to go on it looks for the app in every environment of every project the user can reach, narrowed by whatever was chosen (--org, --project, --environment). A name present in more than one place is ambiguous and returns an error naming each org/project/environment, so a bare command never guesses between two apps that share a name.
type ExitCode ¶ added in v0.14.0
type ExitCode int
ExitCode ends the process with that status. The command already said why on stderr, so there is nothing more to print.