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

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

Issue 6116049: Move logging functionality into new cmd.Log type
Left Patch Set: Move logging functionality into new cmd.Log type Created 12 years, 11 months ago
Right Patch Set: Move logging functionality into new cmd.Log type Created 12 years, 11 months 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/context_test.go ('k') | cmd/jujud/main.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/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 }
LEFTRIGHT

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