LEFT | RIGHT |
1 package main | 1 package main |
2 | 2 |
3 import ( | 3 import ( |
| 4 "launchpad.net/gnuflag" |
4 "launchpad.net/juju/go/cmd" | 5 "launchpad.net/juju/go/cmd" |
5 "os" | 6 "os" |
| 7 ) |
| 8 |
| 9 // When we import an environment provider implementation |
| 10 // here, it will register itself with environs, and hence |
| 11 // be available to the juju command. |
| 12 import ( |
| 13 _ "launchpad.net/juju/go/environs/ec2" |
6 ) | 14 ) |
7 | 15 |
8 var jujuDoc = ` | 16 var jujuDoc = ` |
9 juju provides easy, intelligent service orchestration on top of environments | 17 juju provides easy, intelligent service orchestration on top of environments |
10 such as OpenStack, Amazon AWS, or bare metal. | 18 such as OpenStack, Amazon AWS, or bare metal. |
11 | 19 |
12 https://juju.ubuntu.com/ | 20 https://juju.ubuntu.com/ |
13 ` | 21 ` |
14 | 22 |
15 // Main registers subcommands for the juju executable, and hands over control | 23 // Main registers subcommands for the juju executable, and hands over control |
16 // to the cmd package. This function is not redundant with main, because it | 24 // to the cmd package. This function is not redundant with main, because it |
17 // provides an entry point for testing with arbitrary command line arguments. | 25 // provides an entry point for testing with arbitrary command line arguments. |
18 func Main(args []string) { | 26 func Main(args []string) { |
19 » juju := cmd.NewLoggingSuperCommand("juju", "", jujuDoc) | 27 » juju := &cmd.SuperCommand{Name: "juju", Doc: jujuDoc, Log: &cmd.Log{}} |
20 juju.Register(&BootstrapCommand{}) | 28 juju.Register(&BootstrapCommand{}) |
| 29 juju.Register(&DestroyCommand{}) |
21 os.Exit(cmd.Main(juju, cmd.DefaultContext(), args[1:])) | 30 os.Exit(cmd.Main(juju, cmd.DefaultContext(), args[1:])) |
22 } | 31 } |
23 | 32 |
24 func main() { | 33 func main() { |
25 Main(os.Args) | 34 Main(os.Args) |
26 } | 35 } |
| 36 |
| 37 func addEnvironFlags(name *string, f *gnuflag.FlagSet) { |
| 38 f.StringVar(name, "e", "", "juju environment to operate in") |
| 39 f.StringVar(name, "environment", "", "") |
| 40 } |
LEFT | RIGHT |