LEFT | RIGHT |
(no file at all) | |
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 var jujudDoc = ` | 8 var jujudDoc = ` |
9 juju provides easy, intelligent service orchestration on top of environments | 9 juju provides easy, intelligent service orchestration on top of environments |
10 such as OpenStack, Amazon AWS, or bare metal. jujud is a component of juju. | 10 such as OpenStack, Amazon AWS, or bare metal. jujud is a component of juju. |
11 | 11 |
12 https://juju.ubuntu.com/ | 12 https://juju.ubuntu.com/ |
13 ` | 13 ` |
14 | 14 |
15 // Main registers subcommands for the jujud executable, and hands over control | 15 // Main registers subcommands for the jujud executable, and hands over control |
16 // to the cmd package. This function is not redundant with main, because it | 16 // 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. | 17 // provides an entry point for testing with arbitrary command line arguments. |
18 func Main(args []string) { | 18 func Main(args []string) { |
19 » jc := cmd.NewSuperCommand("jujud", jujudDoc) | 19 » jujud := cmd.NewSuperCommand("jujud", "", jujudDoc) |
20 » jc.Register(&InitzkCommand{}) | 20 » jujud.Register(&InitzkCommand{}) |
21 » jc.Register(NewUnitAgent()) | 21 » jujud.Register(NewUnitAgent()) |
22 » jc.Register(NewMachineAgent()) | 22 » jujud.Register(NewMachineAgent()) |
23 » jc.Register(NewProvisioningAgent()) | 23 » jujud.Register(NewProvisioningAgent()) |
24 » cmd.Main(jc, args) | 24 » os.Exit(cmd.Main(jujud, cmd.DefaultContext(), args[1:])) |
25 } | 25 } |
26 | 26 |
27 func main() { | 27 func main() { |
28 Main(os.Args) | 28 Main(os.Args) |
29 } | 29 } |
LEFT | RIGHT |