LEFT | RIGHT |
1 package main | 1 package main |
2 | 2 |
3 import ( | 3 import ( |
4 "launchpad.net/juju/go/cmd" | 4 "launchpad.net/juju/go/cmd" |
5 "os" | 5 "os" |
6 ) | 6 ) |
7 | 7 |
8 // Environment types to include. | 8 // Environment types to include. |
9 import ( | 9 import ( |
10 _ "launchpad.net/juju/go/environs/ec2" | 10 _ "launchpad.net/juju/go/environs/ec2" |
11 ) | 11 ) |
12 | 12 |
13 var jujuDoc = ` | 13 var jujuDoc = ` |
14 juju provides easy, intelligent service orchestration on top of environments | 14 juju provides easy, intelligent service orchestration on top of environments |
15 such as OpenStack, Amazon AWS, or bare metal. | 15 such as OpenStack, Amazon AWS, or bare metal. |
16 | 16 |
17 https://juju.ubuntu.com/ | 17 https://juju.ubuntu.com/ |
18 ` | 18 ` |
19 | 19 |
20 // Main registers subcommands for the juju executable, and hands over control | 20 // Main registers subcommands for the juju executable, and hands over control |
21 // to the cmd package. This function is not redundant with main, because it | 21 // to the cmd package. This function is not redundant with main, because it |
22 // provides an entry point for testing with arbitrary command line arguments. | 22 // provides an entry point for testing with arbitrary command line arguments. |
23 func Main(args []string) { | 23 func Main(args []string) { |
24 » jc := cmd.NewSuperCommand("juju", jujuDoc) | 24 » juju := cmd.NewSuperCommand("juju", "", jujuDoc) |
25 » jc.Register(&BootstrapCommand{}) | 25 » juju.Register(&BootstrapCommand{}) |
26 » jc.Register(&DestroyCommand{}) | 26 » juju.Register(&DestroyCommand{}) |
27 » cmd.Main(jc, args) | 27 » os.Exit(cmd.Main(juju, cmd.DefaultContext(), args[1:])) |
28 } | 28 } |
29 | 29 |
30 func main() { | 30 func main() { |
31 Main(os.Args) | 31 Main(os.Args) |
32 } | 32 } |
LEFT | RIGHT |