Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(74)

Delta Between Two Patch Sets: cmd/juju/destroyenvironment.go

Issue 7370043: Change the way aliases to subcommands are handled.
Left Patch Set: Created 12 years, 1 month ago
Right Patch Set: Change the way aliases to subcommands are handled. Created 12 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « cmd/juju/deploy.go ('k') | cmd/juju/destroymachine.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 package main 1 package main
2 2
3 import ( 3 import (
4 "launchpad.net/gnuflag" 4 "launchpad.net/gnuflag"
5 "launchpad.net/juju-core/cmd" 5 "launchpad.net/juju-core/cmd"
6 "launchpad.net/juju-core/environs" 6 "launchpad.net/juju-core/environs"
7 ) 7 )
8 8
9 // DestroyEnvironmentCommand destroys an environment. 9 // DestroyEnvironmentCommand destroys an environment.
10 type DestroyEnvironmentCommand struct { 10 type DestroyEnvironmentCommand struct {
11 EnvName string 11 EnvName string
12 } 12 }
13 13
14 func (c *DestroyEnvironmentCommand) Info() *cmd.Info { 14 func (c *DestroyEnvironmentCommand) Info() *cmd.Info {
15 » return cmd.NewInfo( 15 » return &cmd.Info{
16 » » "destroy-environment", "[options]", 16 » » Name: "destroy-environment",
17 » » "terminate all machines and other associated resources for an en vironment", 17 » » Purpose: "terminate all machines and other associated resources for an environment",
18 » » "", 18 » }
19 » )
20 } 19 }
21 20
22 func (c *DestroyEnvironmentCommand) SetFlags(f *gnuflag.FlagSet) { 21 func (c *DestroyEnvironmentCommand) SetFlags(f *gnuflag.FlagSet) {
23 addEnvironFlags(&c.EnvName, f) 22 addEnvironFlags(&c.EnvName, f)
24 } 23 }
25 24
26 func (c *DestroyEnvironmentCommand) Init(args []string) error { 25 func (c *DestroyEnvironmentCommand) Init(args []string) error {
27 return cmd.CheckEmpty(args) 26 return cmd.CheckEmpty(args)
28 } 27 }
29 28
30 func (c *DestroyEnvironmentCommand) Run(_ *cmd.Context) error { 29 func (c *DestroyEnvironmentCommand) Run(_ *cmd.Context) error {
31 environ, err := environs.NewFromName(c.EnvName) 30 environ, err := environs.NewFromName(c.EnvName)
32 if err != nil { 31 if err != nil {
33 return err 32 return err
34 } 33 }
35 return environ.Destroy(nil) 34 return environ.Destroy(nil)
36 } 35 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b