brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@apache.org
Subject [01/50] [abbrv] brooklyn-client git commit: cleans up formatting using go fmt
Date Tue, 08 Mar 2016 13:19:34 GMT
Repository: brooklyn-client
Updated Branches:
  refs/heads/master e98252e7e -> 0623158fd


http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/catalog.go
----------------------------------------------------------------------
diff --git a/commands/catalog.go b/commands/catalog.go
index a7991c5..aac0a3e 100644
--- a/commands/catalog.go
+++ b/commands/catalog.go
@@ -1,13 +1,13 @@
 package commands
 
 import (
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/catalog"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
-	"github.com/brooklyncentral/brooklyn-cli/terminal"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/brooklyncentral/brooklyn-cli/terminal"
+	"github.com/codegangsta/cli"
 )
 
 type Catalog struct {
@@ -30,13 +30,13 @@ func (cmd *Catalog) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Catalog) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	catalog, err := catalog.Catalog(cmd.network)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	table := terminal.NewTable([]string{"Id", "Name", "Description"})
 	for _, app := range catalog {
 		table.Add(app.Id, app.Name, app.Description)

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/config.go
----------------------------------------------------------------------
diff --git a/commands/config.go b/commands/config.go
index d6c59e8..45be11f 100644
--- a/commands/config.go
+++ b/commands/config.go
@@ -2,13 +2,13 @@ package commands
 
 import (
 	"fmt"
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/entity_config"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
-	"github.com/brooklyncentral/brooklyn-cli/terminal"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/brooklyncentral/brooklyn-cli/terminal"
+	"github.com/codegangsta/cli"
 )
 
 type Config struct {
@@ -31,30 +31,30 @@ func (cmd *Config) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Config) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
-    if c.Args().Present() {
-        configValue, err := entity_config.ConfigValue(cmd.network, scope.Application, scope.Entity, c.Args().First())
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
+	if c.Args().Present() {
+		configValue, err := entity_config.ConfigValue(cmd.network, scope.Application, scope.Entity, c.Args().First())
 
-        if nil != err {
+		if nil != err {
 			error_handler.ErrorExit(err)
-        }
+		}
 		displayValue, err := stringRepresentation(configValue)
 		if nil != err {
 			error_handler.ErrorExit(err)
 		}
-        fmt.Println(displayValue)
+		fmt.Println(displayValue)
 
-    } else {
-        config, err := entity_config.ConfigCurrentState(cmd.network, scope.Application, scope.Entity)
-        if nil != err {
-            error_handler.ErrorExit(err)
-        }
-        table := terminal.NewTable([]string{"Key", "Value"})
-        for key, value := range config {
-            table.Add(key, fmt.Sprintf("%v", value))
-        }
-        table.Print()
-    }
+	} else {
+		config, err := entity_config.ConfigCurrentState(cmd.network, scope.Application, scope.Entity)
+		if nil != err {
+			error_handler.ErrorExit(err)
+		}
+		table := terminal.NewTable([]string{"Key", "Value"})
+		for key, value := range config {
+			table.Add(key, fmt.Sprintf("%v", value))
+		}
+		table.Print()
+	}
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/delete-catalog-application.go
----------------------------------------------------------------------
diff --git a/commands/delete-catalog-application.go b/commands/delete-catalog-application.go
index 810e8d4..f034763 100644
--- a/commands/delete-catalog-application.go
+++ b/commands/delete-catalog-application.go
@@ -12,4 +12,4 @@ func NewDeleteCatalogApplication(network *net.Network) (cmd *DeleteCatalogApplic
 	cmd = new(DeleteCatalogApplication)
 	cmd.network = network
 	return
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/delete-catalog-entity.go
----------------------------------------------------------------------
diff --git a/commands/delete-catalog-entity.go b/commands/delete-catalog-entity.go
index 9e81172..060c1fa 100644
--- a/commands/delete-catalog-entity.go
+++ b/commands/delete-catalog-entity.go
@@ -12,4 +12,4 @@ func NewDeleteCatalogEntity(network *net.Network) (cmd *DeleteCatalogEntity) {
 	cmd = new(DeleteCatalogEntity)
 	cmd.network = network
 	return
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/delete-catalog-policy.go
----------------------------------------------------------------------
diff --git a/commands/delete-catalog-policy.go b/commands/delete-catalog-policy.go
index 521f5d4..c86a0c1 100644
--- a/commands/delete-catalog-policy.go
+++ b/commands/delete-catalog-policy.go
@@ -12,4 +12,4 @@ func NewDeleteCatalogPolicy(network *net.Network) (cmd *DeleteCatalogPolicy) {
 	cmd = new(DeleteCatalogPolicy)
 	cmd.network = network
 	return
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/delete.go
----------------------------------------------------------------------
diff --git a/commands/delete.go b/commands/delete.go
index e2e9882..20e4cc0 100644
--- a/commands/delete.go
+++ b/commands/delete.go
@@ -2,12 +2,12 @@ package commands
 
 import (
 	"fmt"
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/application"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/codegangsta/cli"
 )
 
 type Delete struct {
@@ -30,12 +30,12 @@ func (cmd *Delete) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Delete) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	del, err := application.Delete(cmd.network, scope.Application)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	fmt.Println(del)
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/deploy.go
----------------------------------------------------------------------
diff --git a/commands/deploy.go b/commands/deploy.go
index c5fb78e..a05edda 100644
--- a/commands/deploy.go
+++ b/commands/deploy.go
@@ -1,17 +1,17 @@
 package commands
 
 import (
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/application"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
-    "github.com/brooklyncentral/brooklyn-cli/models"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/brooklyncentral/brooklyn-cli/models"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-	"github.com/brooklyncentral/brooklyn-cli/error_handler"
-    "github.com/brooklyncentral/brooklyn-cli/terminal"
-    "io/ioutil"
+	"github.com/brooklyncentral/brooklyn-cli/terminal"
+	"github.com/codegangsta/cli"
+	"io/ioutil"
 	"os"
-    "strings"
+	"strings"
 )
 
 type Deploy struct {
@@ -34,13 +34,13 @@ func (cmd *Deploy) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Deploy) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
-    
-    var create models.TaskSummary
-    var err error
-    var blueprint []byte
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
+
+	var create models.TaskSummary
+	var err error
+	var blueprint []byte
 	if c.Args().First() == "" {
 		error_handler.ErrorExit("A filename or '-' must be provided as the first argument", error_handler.CLIUsageErrorExitCode)
 	}
@@ -53,15 +53,15 @@ func (cmd *Deploy) Run(scope scope.Scope, c *cli.Context) {
 	} else {
 		create, err = application.Create(cmd.network, c.Args().First())
 	}
-    if nil != err {
-        if httpErr, ok := err.(net.HttpError); ok {
-            error_handler.ErrorExit(strings.Join([]string{httpErr.Status, httpErr.Body}, "\n"), httpErr.Code)
-        } else {
-            error_handler.ErrorExit(err)
-        }
-    }
-    table := terminal.NewTable([]string{"Id:",create.EntityId})
-    table.Add("Name:", create.EntityDisplayName)
-    table.Add("Status:", create.CurrentStatus)
-    table.Print()
+	if nil != err {
+		if httpErr, ok := err.(net.HttpError); ok {
+			error_handler.ErrorExit(strings.Join([]string{httpErr.Status, httpErr.Body}, "\n"), httpErr.Code)
+		} else {
+			error_handler.ErrorExit(err)
+		}
+	}
+	table := terminal.NewTable([]string{"Id:", create.EntityId})
+	table.Add("Name:", create.EntityDisplayName)
+	table.Add("Status:", create.CurrentStatus)
+	table.Print()
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/destroy-policy.go
----------------------------------------------------------------------
diff --git a/commands/destroy-policy.go b/commands/destroy-policy.go
index 158c617..e65021d 100644
--- a/commands/destroy-policy.go
+++ b/commands/destroy-policy.go
@@ -2,12 +2,12 @@ package commands
 
 import (
 	"fmt"
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/entity_policies"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/codegangsta/cli"
 )
 
 type DestroyPolicy struct {
@@ -30,12 +30,12 @@ func (cmd *DestroyPolicy) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *DestroyPolicy) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	spec, err := entity_policies.DestroyPolicy(cmd.network, scope.Application, scope.Entity, c.Args().First())
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	fmt.Println(spec)
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/effector.go
----------------------------------------------------------------------
diff --git a/commands/effector.go b/commands/effector.go
index dfafd4a..af3fc55 100644
--- a/commands/effector.go
+++ b/commands/effector.go
@@ -1,14 +1,14 @@
 package commands
 
 import (
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/entity_effectors"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
+	"github.com/brooklyncentral/brooklyn-cli/scope"
 	"github.com/brooklyncentral/brooklyn-cli/terminal"
+	"github.com/codegangsta/cli"
 	"strings"
-	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
 )
 
 type Effector struct {
@@ -31,22 +31,22 @@ func (cmd *Effector) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Effector) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	effectors, err := entity_effectors.EffectorList(cmd.network, scope.Application, scope.Entity)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	table := terminal.NewTable([]string{"Name", "Description", "Parameters"})
 	for _, effector := range effectors {
 		var parameters []string
 		for _, parameter := range effector.Parameters {
 			parameters = append(parameters, parameter.Name)
 		}
-        if !c.Args().Present() || c.Args().First() == effector.Name {
-            table.Add(effector.Name, effector.Description, strings.Join(parameters, ","))
-        }
+		if !c.Args().Present() || c.Args().First() == effector.Name {
+			table.Add(effector.Name, effector.Description, strings.Join(parameters, ","))
+		}
 	}
 	table.Print()
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/entity.go
----------------------------------------------------------------------
diff --git a/commands/entity.go b/commands/entity.go
index 1529722..e608a65 100644
--- a/commands/entity.go
+++ b/commands/entity.go
@@ -1,16 +1,16 @@
 package commands
 
 import (
-	"github.com/codegangsta/cli"
+	"fmt"
 	"github.com/brooklyncentral/brooklyn-cli/api/entities"
+	"github.com/brooklyncentral/brooklyn-cli/api/entity_sensors"
+	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
-	"github.com/brooklyncentral/brooklyn-cli/terminal"
-    "github.com/brooklyncentral/brooklyn-cli/command_metadata"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "os"
-    "fmt"
-    "github.com/brooklyncentral/brooklyn-cli/api/entity_sensors"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/brooklyncentral/brooklyn-cli/terminal"
+	"github.com/codegangsta/cli"
+	"os"
 )
 
 type Entity struct {
@@ -26,12 +26,12 @@ func NewEntity(network *net.Network) (cmd *Entity) {
 func (cmd *Entity) Metadata() command_metadata.CommandMetadata {
 	return command_metadata.CommandMetadata{
 		Name:        "entity",
-		Aliases:     []string{"entities","ent","ents"},
+		Aliases:     []string{"entities", "ent", "ents"},
 		Description: "Show the entities of an application or entity",
 		Usage:       "BROOKLYN_NAME SCOPE entity [ENTITYID]",
-		Flags:       []cli.Flag{
+		Flags: []cli.Flag{
 			cli.StringSliceFlag{
-				Name: "children, c",
+				Name:  "children, c",
 				Usage: "List children of the entity",
 			},
 		},
@@ -39,9 +39,9 @@ func (cmd *Entity) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Entity) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	if c.NumFlags() > 0 && c.FlagNames()[0] == "children" {
 		cmd.listentity(scope.Application, c.StringSlice("children")[0])
 	} else {
@@ -59,21 +59,22 @@ func (cmd *Entity) Run(scope scope.Scope, c *cli.Context) {
 
 const serviceStateSensor = "service.state"
 const serviceIsUp = "service.isUp"
+
 func (cmd *Entity) show(application, entity string) {
 	summary, err := entities.GetEntity(cmd.network, application, entity)
-    if nil != err {
-        fmt.Fprintf(os.Stderr, "Error: %s\n", err)
-        os.Exit(1)
-    }
+	if nil != err {
+		fmt.Fprintf(os.Stderr, "Error: %s\n", err)
+		os.Exit(1)
+	}
 	table := terminal.NewTable([]string{"Id:", summary.Id})
-    table.Add("Name:", summary.Name)
-    configState, err := entity_sensors.CurrentState(cmd.network, application, entity)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
-    if serviceState, ok := configState[serviceStateSensor]; ok {
-        table.Add("Status:", fmt.Sprintf("%v", serviceState))
-    }
+	table.Add("Name:", summary.Name)
+	configState, err := entity_sensors.CurrentState(cmd.network, application, entity)
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
+	if serviceState, ok := configState[serviceStateSensor]; ok {
+		table.Add("Status:", fmt.Sprintf("%v", serviceState))
+	}
 	if serviceIsUp, ok := configState[serviceIsUp]; ok {
 		table.Add("ServiceUp:", fmt.Sprintf("%v", serviceIsUp))
 	}
@@ -82,12 +83,11 @@ func (cmd *Entity) show(application, entity string) {
 	table.Print()
 }
 
-
 func (cmd *Entity) listapp(application string) {
 	entitiesList, err := entities.EntityList(cmd.network, application)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	table := terminal.NewTable([]string{"Id", "Name", "Type"})
 	for _, entityitem := range entitiesList {
 		table.Add(entityitem.Id, entityitem.Name, entityitem.Type)
@@ -97,13 +97,13 @@ func (cmd *Entity) listapp(application string) {
 
 func (cmd *Entity) listentity(application string, entity string) {
 	entitiesList, err := entities.Children(cmd.network, application, entity)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 
 	table := terminal.NewTable([]string{"Id", "Name", "Type"})
 	for _, entityitem := range entitiesList {
 		table.Add(entityitem.Id, entityitem.Name, entityitem.Type)
 	}
 	table.Print()
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/invoke.go
----------------------------------------------------------------------
diff --git a/commands/invoke.go b/commands/invoke.go
index b9663e7..e478430 100644
--- a/commands/invoke.go
+++ b/commands/invoke.go
@@ -1,16 +1,16 @@
 package commands
 
 import (
-	"github.com/codegangsta/cli"
+	"errors"
+	"fmt"
 	"github.com/brooklyncentral/brooklyn-cli/api/entity_effectors"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-	"fmt"
-	"github.com/brooklyncentral/brooklyn-cli/error_handler"
-	"strings"
-	"errors"
+	"github.com/codegangsta/cli"
 	"io/ioutil"
+	"strings"
 )
 
 type Invoke struct {
@@ -18,18 +18,17 @@ type Invoke struct {
 }
 
 type Stop struct {
-    Invoke
+	Invoke
 }
 
 type Start struct {
-    Invoke
+	Invoke
 }
 
 type Restart struct {
-    Invoke
+	Invoke
 }
 
-
 func NewInvoke(network *net.Network) (cmd *Invoke) {
 	cmd = new(Invoke)
 	cmd.network = network
@@ -54,11 +53,11 @@ func NewInvokeRestart(network *net.Network) (cmd *Restart) {
 	return
 }
 
-var paramFlags = []cli.Flag {
-    cli.StringSliceFlag{
-        Name: "param, P",
-        Usage: "Parameter and value separated by '=', e.g. -P x=y",
-    },
+var paramFlags = []cli.Flag{
+	cli.StringSliceFlag{
+		Name:  "param, P",
+		Usage: "Parameter and value separated by '=', e.g. -P x=y",
+	},
 }
 
 func (cmd *Invoke) Metadata() command_metadata.CommandMetadata {
@@ -98,50 +97,53 @@ func (cmd *Restart) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Invoke) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	parms := c.StringSlice("param")
 	invoke(cmd.network, scope.Application, scope.Entity, scope.Effector, parms)
 }
 
 const stopEffector = "stop"
+
 func (cmd *Stop) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	parms := c.StringSlice("param")
 	invoke(cmd.network, scope.Application, scope.Entity, stopEffector, parms)
 }
 
 const startEffector = "start"
+
 func (cmd *Start) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	parms := c.StringSlice("param")
 	invoke(cmd.network, scope.Application, scope.Entity, startEffector, parms)
 }
 
 const restartEffector = "restart"
+
 func (cmd *Restart) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	parms := c.StringSlice("param")
 	invoke(cmd.network, scope.Application, scope.Entity, restartEffector, parms)
 }
 
 func invoke(network *net.Network, application, entity, effector string, parms []string) {
-    names, vals, err := extractParams(parms)
-    result, err := entity_effectors.TriggerEffector(network, application, entity, effector, names, vals)
-    if nil != err  {
-        error_handler.ErrorExit(err)
-    } else {
-        if "" != result {
-            fmt.Println(result)
-        }
-    }
+	names, vals, err := extractParams(parms)
+	result, err := entity_effectors.TriggerEffector(network, application, entity, effector, names, vals)
+	if nil != err {
+		error_handler.ErrorExit(err)
+	} else {
+		if "" != result {
+			fmt.Println(result)
+		}
+	}
 }
 
 func extractParams(parms []string) ([]string, []string, error) {
@@ -160,6 +162,7 @@ func extractParams(parms []string) ([]string, []string, error) {
 }
 
 const paramDataPrefix string = "@"
+
 func extractParamValue(rawParam string) (string, error) {
 	var err error
 	var val string

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/list.go
----------------------------------------------------------------------
diff --git a/commands/list.go b/commands/list.go
index 0f31057..61b3720 100644
--- a/commands/list.go
+++ b/commands/list.go
@@ -1,29 +1,29 @@
 package commands
 
 import (
-	"github.com/brooklyncentral/brooklyn-cli/net"
-	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
-	"github.com/codegangsta/cli"
 	"fmt"
-	"strings"
 	"github.com/brooklyncentral/brooklyn-cli/command"
+	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/codegangsta/cli"
+	"strings"
 )
 
 type List struct {
-	network *net.Network
-    listCommands map[string]command.Command
+	network      *net.Network
+	listCommands map[string]command.Command
 }
 
 func NewList(network *net.Network) (cmd *List) {
 	cmd = new(List)
 	cmd.network = network
 	cmd.listCommands = map[string]command.Command{
-//		ListApplicationCommand: NewApplications(cmd.network),
-//		ListEntityCommand: NewEntities(cmd.network),
-//		ListSensorCommand: NewSensors(cmd.network),
-//		ListEffectorCommand: NewEffector(cmd.network),
+	//		ListApplicationCommand: NewApplications(cmd.network),
+	//		ListEntityCommand: NewEntities(cmd.network),
+	//		ListSensorCommand: NewSensors(cmd.network),
+	//		ListEffectorCommand: NewEffector(cmd.network),
 	}
 	return
 }
@@ -33,7 +33,7 @@ const ListEntityCommand = "entities"
 const ListSensorCommand = "sensors"
 const ListEffectorCommand = "effectors"
 
-var listCommands = []string {
+var listCommands = []string{
 	ListApplicationCommand,
 	ListEntityCommand,
 	ListSensorCommand,
@@ -41,7 +41,7 @@ var listCommands = []string {
 }
 var listCommandsUsage = strings.Join(listCommands, " | ")
 
-func (cmd *List) SubCommandNames() ([]string) {
+func (cmd *List) SubCommandNames() []string {
 	return listCommands
 }
 
@@ -55,7 +55,7 @@ func (cmd *List) Metadata() command_metadata.CommandMetadata {
 		Description: "List details for a variety of operands",
 		Usage:       "BROOKLYN_NAME SCOPE list (" + listCommandsUsage + ")",
 		Flags:       []cli.Flag{},
-		Operands:    []command_metadata.CommandMetadata {
+		Operands: []command_metadata.CommandMetadata{
 			cmd.SubCommand(ListApplicationCommand).Metadata(),
 			cmd.SubCommand(ListEntityCommand).Metadata(),
 			cmd.SubCommand(ListSensorCommand).Metadata(),
@@ -65,8 +65,8 @@ func (cmd *List) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *List) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
-	fmt.Printf( "Unrecognised item for list, please use one of (%s)\n", listCommandsUsage)
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
+	fmt.Printf("Unrecognised item for list, please use one of (%s)\n", listCommandsUsage)
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/locations.go
----------------------------------------------------------------------
diff --git a/commands/locations.go b/commands/locations.go
index 276e25c..3e4c652 100644
--- a/commands/locations.go
+++ b/commands/locations.go
@@ -1,13 +1,13 @@
 package commands
 
 import (
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/locations"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
-	"github.com/brooklyncentral/brooklyn-cli/terminal"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/brooklyncentral/brooklyn-cli/terminal"
+	"github.com/codegangsta/cli"
 )
 
 type Locations struct {
@@ -30,13 +30,13 @@ func (cmd *Locations) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Locations) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	locationList, err := locations.LocationList(cmd.network)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	table := terminal.NewTable([]string{"Id", "Name", "Spec"})
 	for _, location := range locationList {
 		table.Add(location.Id, location.Name, location.Spec)

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/login.go
----------------------------------------------------------------------
diff --git a/commands/login.go b/commands/login.go
index f75b71f..83fd8c2 100644
--- a/commands/login.go
+++ b/commands/login.go
@@ -36,7 +36,7 @@ func (cmd *Login) Metadata() command_metadata.CommandMetadata {
 
 func (cmd *Login) Run(scope scope.Scope, c *cli.Context) {
 	if !c.Args().Present() {
-		error_handler.ErrorExit("A URL must be provided as the first argument",error_handler.CLIUsageErrorExitCode)
+		error_handler.ErrorExit("A URL must be provided as the first argument", error_handler.CLIUsageErrorExitCode)
 	}
 
 	// If an argument was not supplied, it is set to empty string
@@ -47,15 +47,15 @@ func (cmd *Login) Run(scope scope.Scope, c *cli.Context) {
 	if err := net.VerifyLoginURL(cmd.network); err != nil {
 		error_handler.ErrorExit(err)
 	}
-	
+
 	// Strip off trailing '/' from URL if present.
 	if cmd.network.BrooklynUrl[len(cmd.network.BrooklynUrl)-1] == '/' {
 		if len(cmd.network.BrooklynUrl) == 1 {
 			error_handler.ErrorExit("URL must not be a single \"/\" character", error_handler.CLIUsageErrorExitCode)
 		}
-		cmd.network.BrooklynUrl = cmd.network.BrooklynUrl[0:len(cmd.network.BrooklynUrl)-1]
+		cmd.network.BrooklynUrl = cmd.network.BrooklynUrl[0 : len(cmd.network.BrooklynUrl)-1]
 	}
-	
+
 	// Prompt for password if not supplied (password is not echoed to screen
 	if cmd.network.BrooklynUser != "" && cmd.network.BrooklynPass == "" {
 		fmt.Print("Enter Password: ")
@@ -84,10 +84,10 @@ func (cmd *Login) Run(scope scope.Scope, c *cli.Context) {
 
 	cmd.config.Map["target"] = cmd.network.BrooklynUrl
 	cmd.config.Write()
-	
+
 	loginVersion, err := version.Version(cmd.network)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	fmt.Printf("Connected to Brooklyn version %s at %s\n", loginVersion.Version, cmd.network.BrooklynUrl)
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/policy.go
----------------------------------------------------------------------
diff --git a/commands/policy.go b/commands/policy.go
index 0a1dc27..9c502c9 100644
--- a/commands/policy.go
+++ b/commands/policy.go
@@ -1,16 +1,16 @@
 package commands
 
 import (
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/entity_policies"
-    "github.com/brooklyncentral/brooklyn-cli/api/entity_policy_config"
-    "github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/api/entity_policy_config"
+	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/brooklyncentral/brooklyn-cli/models"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/terminal"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
-    "github.com/brooklyncentral/brooklyn-cli/models"
-    "sort"
+	"github.com/brooklyncentral/brooklyn-cli/terminal"
+	"github.com/codegangsta/cli"
+	"sort"
 )
 
 type Policy struct {
@@ -21,20 +21,20 @@ type policyConfigList []models.PolicyConfigList
 
 // Len is the number of elements in the collection.
 func (configs policyConfigList) Len() int {
-    return len(configs)
+	return len(configs)
 }
 
 // Less reports whether the element with
 // index i should sort before the element with index j.
 func (configs policyConfigList) Less(i, j int) bool {
-    return configs[i].Name < configs[j].Name
+	return configs[i].Name < configs[j].Name
 }
 
 // Swap swaps the elements with indexes i and j.
 func (configs policyConfigList) Swap(i, j int) {
-    temp := configs[i]
-    configs[i] = configs[j]
-    configs[j] = temp
+	temp := configs[i]
+	configs[i] = configs[j]
+	configs[j] = temp
 }
 
 func NewPolicy(network *net.Network) (cmd *Policy) {
@@ -46,51 +46,51 @@ func NewPolicy(network *net.Network) (cmd *Policy) {
 func (cmd *Policy) Metadata() command_metadata.CommandMetadata {
 	return command_metadata.CommandMetadata{
 		Name:        "policy",
-        Aliases:     []string{"policies","pol","pols"},
-        Description: "Show the policies for an application or entity",
+		Aliases:     []string{"policies", "pol", "pols"},
+		Description: "Show the policies for an application or entity",
 		Usage:       "BROOKLYN_NAME SCOPE policy [NAME]",
 		Flags:       []cli.Flag{},
 	}
 }
 
 func (cmd *Policy) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
-    if c.Args().Present() {
-        cmd.show(scope.Application, scope.Entity, c.Args().First())
-    } else {
-        cmd.list(scope.Application, scope.Entity)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
+	if c.Args().Present() {
+		cmd.show(scope.Application, scope.Entity, c.Args().First())
+	} else {
+		cmd.list(scope.Application, scope.Entity)
+	}
 }
 
 func (cmd *Policy) show(application, entity, policy string) {
-    configs, err := entity_policy_config.GetAllConfigValues(cmd.network, application, entity, policy)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
-    table := terminal.NewTable([]string{"Name", "Value", "Description"})
-    var theConfigs policyConfigList = configs
-    sort.Sort(theConfigs)
-    
-    for _, config := range theConfigs {
-        value, err := entity_policy_config.GetConfigValue(cmd.network, application, entity, policy, config.Name)
-        if nil != err {
-            error_handler.ErrorExit(err)
-        }
-        table.Add(config.Name, value, config.Description)
-    }
-    table.Print()
+	configs, err := entity_policy_config.GetAllConfigValues(cmd.network, application, entity, policy)
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
+	table := terminal.NewTable([]string{"Name", "Value", "Description"})
+	var theConfigs policyConfigList = configs
+	sort.Sort(theConfigs)
+
+	for _, config := range theConfigs {
+		value, err := entity_policy_config.GetConfigValue(cmd.network, application, entity, policy, config.Name)
+		if nil != err {
+			error_handler.ErrorExit(err)
+		}
+		table.Add(config.Name, value, config.Description)
+	}
+	table.Print()
 }
 
 func (cmd *Policy) list(application, entity string) {
-    policies, err := entity_policies.PolicyList(cmd.network, application, entity)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
-    table := terminal.NewTable([]string{"Id", "Name", "State"})
-    for _, policy := range policies {
-        table.Add(policy.Id, policy.Name, string(policy.State))
-    }
-    table.Print()
-}
\ No newline at end of file
+	policies, err := entity_policies.PolicyList(cmd.network, application, entity)
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
+	table := terminal.NewTable([]string{"Id", "Name", "State"})
+	for _, policy := range policies {
+		table.Add(policy.Id, policy.Name, string(policy.State))
+	}
+	table.Print()
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/rename.go
----------------------------------------------------------------------
diff --git a/commands/rename.go b/commands/rename.go
index baf0b08..eff6991 100644
--- a/commands/rename.go
+++ b/commands/rename.go
@@ -2,12 +2,12 @@ package commands
 
 import (
 	"fmt"
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/entities"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/codegangsta/cli"
 )
 
 type Rename struct {
@@ -30,12 +30,12 @@ func (cmd *Rename) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Rename) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	rename, err := entities.Rename(cmd.network, scope.Application, scope.Entity, c.Args().First())
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	fmt.Println(rename)
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/reset-catalog.go
----------------------------------------------------------------------
diff --git a/commands/reset-catalog.go b/commands/reset-catalog.go
index eee816e..d0e7e7a 100644
--- a/commands/reset-catalog.go
+++ b/commands/reset-catalog.go
@@ -12,4 +12,4 @@ func NewResetCatalog(network *net.Network) (cmd *ResetCatalog) {
 	cmd = new(ResetCatalog)
 	cmd.network = network
 	return
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/sensor.go
----------------------------------------------------------------------
diff --git a/commands/sensor.go b/commands/sensor.go
index 5214d55..d980f07 100644
--- a/commands/sensor.go
+++ b/commands/sensor.go
@@ -2,15 +2,15 @@ package commands
 
 import (
 	"fmt"
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/entity_sensors"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/brooklyncentral/brooklyn-cli/models"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
 	"github.com/brooklyncentral/brooklyn-cli/terminal"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
-    "github.com/brooklyncentral/brooklyn-cli/models"
-    "sort"
+	"github.com/codegangsta/cli"
+	"sort"
 )
 
 type Sensor struct {
@@ -21,20 +21,20 @@ type sensorList []models.SensorSummary
 
 // Len is the number of elements in the collection.
 func (sensors sensorList) Len() int {
-    return len(sensors)
+	return len(sensors)
 }
 
 // Less reports whether the element with
 // index i should sort before the element with index j.
 func (sensors sensorList) Less(i, j int) bool {
-    return sensors[i].Name < sensors[j].Name
+	return sensors[i].Name < sensors[j].Name
 }
 
 // Swap swaps the elements with indexes i and j.
 func (sensors sensorList) Swap(i, j int) {
-    temp := sensors[i]
-    sensors[i] = sensors[j]
-    sensors[j] = temp
+	temp := sensors[i]
+	sensors[i] = sensors[j]
+	sensors[j] = temp
 }
 
 func NewSensor(network *net.Network) (cmd *Sensor) {
@@ -53,13 +53,13 @@ func (cmd *Sensor) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Sensor) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	if c.Args().Present() {
 		cmd.show(scope.Application, scope.Entity, c.Args().First())
 	} else {
-		cmd.list(scope.Application, scope.Entity, )
+		cmd.list(scope.Application, scope.Entity)
 	}
 }
 
@@ -75,22 +75,21 @@ func (cmd *Sensor) show(application, entity, sensor string) {
 	fmt.Println(displayValue)
 }
 
-
 func (cmd *Sensor) list(application, entity string) {
 	sensors, err := entity_sensors.SensorList(cmd.network, application, entity)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
-    var theSensors sensorList = sensors
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
+	var theSensors sensorList = sensors
 	table := terminal.NewTable([]string{"Name", "Description", "Value"})
 
-    sort.Sort(theSensors)
+	sort.Sort(theSensors)
 
 	for _, sensor := range theSensors {
 		value, err := entity_sensors.SensorValue(cmd.network, application, entity, sensor.Name)
-        if nil != err {
-            error_handler.ErrorExit(err)
-        }
+		if nil != err {
+			error_handler.ErrorExit(err)
+		}
 		displayValue, err := stringRepresentation(value)
 		if nil != err {
 			error_handler.ErrorExit(err)

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/set.go
----------------------------------------------------------------------
diff --git a/commands/set.go b/commands/set.go
index b95b632..01c662d 100644
--- a/commands/set.go
+++ b/commands/set.go
@@ -2,12 +2,12 @@ package commands
 
 import (
 	"fmt"
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/entity_config"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/codegangsta/cli"
 )
 
 type SetConfig struct {
@@ -30,12 +30,12 @@ func (cmd *SetConfig) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *SetConfig) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	response, err := entity_config.SetConfig(cmd.network, scope.Application, scope.Entity, scope.Config, c.Args().First())
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	fmt.Println(response)
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/spec.go
----------------------------------------------------------------------
diff --git a/commands/spec.go b/commands/spec.go
index 12b040f..587539c 100644
--- a/commands/spec.go
+++ b/commands/spec.go
@@ -2,12 +2,12 @@ package commands
 
 import (
 	"fmt"
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/entities"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/codegangsta/cli"
 )
 
 type Spec struct {
@@ -30,12 +30,12 @@ func (cmd *Spec) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Spec) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	spec, err := entities.Spec(cmd.network, scope.Application, scope.Entity)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	fmt.Println(spec)
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/start-policy.go
----------------------------------------------------------------------
diff --git a/commands/start-policy.go b/commands/start-policy.go
index 8b84b4a..df319cc 100644
--- a/commands/start-policy.go
+++ b/commands/start-policy.go
@@ -2,12 +2,12 @@ package commands
 
 import (
 	"fmt"
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/entity_policies"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/codegangsta/cli"
 )
 
 type StartPolicy struct {
@@ -30,12 +30,12 @@ func (cmd *StartPolicy) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *StartPolicy) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	spec, err := entity_policies.StartPolicy(cmd.network, scope.Application, scope.Entity, c.Args().First())
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	fmt.Println(spec)
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/stop-policy.go
----------------------------------------------------------------------
diff --git a/commands/stop-policy.go b/commands/stop-policy.go
index 01d3e08..09c2781 100644
--- a/commands/stop-policy.go
+++ b/commands/stop-policy.go
@@ -2,12 +2,12 @@ package commands
 
 import (
 	"fmt"
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/entity_policies"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/codegangsta/cli"
 )
 
 type StopPolicy struct {
@@ -30,12 +30,12 @@ func (cmd *StopPolicy) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *StopPolicy) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	spec, err := entity_policies.StopPolicy(cmd.network, scope.Application, scope.Entity, c.Args().First())
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	fmt.Println(spec)
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/tree.go
----------------------------------------------------------------------
diff --git a/commands/tree.go b/commands/tree.go
index 372fa8b..8e45c11 100644
--- a/commands/tree.go
+++ b/commands/tree.go
@@ -2,13 +2,13 @@ package commands
 
 import (
 	"fmt"
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/application"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
+	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/models"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
-    "github.com/brooklyncentral/brooklyn-cli/error_handler"
+	"github.com/codegangsta/cli"
 )
 
 type Tree struct {
@@ -31,13 +31,13 @@ func (cmd *Tree) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Tree) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
 	trees, err := application.Tree(cmd.network)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
 	cmd.printTrees(trees, "")
 }
 

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/utils.go
----------------------------------------------------------------------
diff --git a/commands/utils.go b/commands/utils.go
index 8fc261c..ba553e0 100644
--- a/commands/utils.go
+++ b/commands/utils.go
@@ -5,17 +5,16 @@ import (
 )
 
 func stringRepresentation(value interface{}) (string, error) {
-	var result string;
+	var result string
 	switch value.(type) {
 	case string:
-		result = value.(string)  // use string value as-is
+		result = value.(string) // use string value as-is
 	default:
 		json, err := json.Marshal(value)
 		if err != nil {
 			return "", err
 		}
-		result = string(json)   // return JSON text representation of value object
+		result = string(json) // return JSON text representation of value object
 	}
-	return result, nil;
+	return result, nil
 }
-

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/commands/version.go
----------------------------------------------------------------------
diff --git a/commands/version.go b/commands/version.go
index 1cb3e19..a68202b 100644
--- a/commands/version.go
+++ b/commands/version.go
@@ -2,12 +2,12 @@ package commands
 
 import (
 	"fmt"
-	"github.com/codegangsta/cli"
 	"github.com/brooklyncentral/brooklyn-cli/api/version"
 	"github.com/brooklyncentral/brooklyn-cli/command_metadata"
 	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"github.com/brooklyncentral/brooklyn-cli/net"
 	"github.com/brooklyncentral/brooklyn-cli/scope"
+	"github.com/codegangsta/cli"
 )
 
 type Version struct {
@@ -30,12 +30,12 @@ func (cmd *Version) Metadata() command_metadata.CommandMetadata {
 }
 
 func (cmd *Version) Run(scope scope.Scope, c *cli.Context) {
-    if err := net.VerifyLoginURL(cmd.network); err != nil {
-        error_handler.ErrorExit(err)
-    }
-    version, err := version.Version(cmd.network)
-    if nil != err {
-        error_handler.ErrorExit(err)
-    }
-    fmt.Println(version.Version)
+	if err := net.VerifyLoginURL(cmd.network); err != nil {
+		error_handler.ErrorExit(err)
+	}
+	version, err := version.Version(cmd.network)
+	if nil != err {
+		error_handler.ErrorExit(err)
+	}
+	fmt.Println(version.Version)
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/error_handler/error.go
----------------------------------------------------------------------
diff --git a/error_handler/error.go b/error_handler/error.go
index 8d9c243..73a525c 100644
--- a/error_handler/error.go
+++ b/error_handler/error.go
@@ -9,8 +9,8 @@ const CLIUsageErrorExitCode int = 1
 const CliGenericErrorExitCode int = 2
 const CLITrapErrorCode int = 3
 
-func ErrorExit(errorvalue interface{}, errorcode ...int) () {
-	switch errorvalue.(type){
+func ErrorExit(errorvalue interface{}, errorcode ...int) {
+	switch errorvalue.(type) {
 	case error:
 		fmt.Fprintln(os.Stderr, errorvalue)
 	case string:

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/io/config.go
----------------------------------------------------------------------
diff --git a/io/config.go b/io/config.go
index be438aa..d0f093c 100644
--- a/io/config.go
+++ b/io/config.go
@@ -1,6 +1,6 @@
 package io
 
-import(
+import (
 	"encoding/json"
 	"github.com/brooklyncentral/brooklyn-cli/error_handler"
 	"os"
@@ -9,7 +9,7 @@ import(
 
 type Config struct {
 	FilePath string
-	Map map[string]interface{}
+	Map      map[string]interface{}
 }
 
 func GetConfig() (config *Config) {
@@ -26,19 +26,19 @@ func GetConfig() (config *Config) {
 		config.Write()
 	}
 	config.Read()
-	return 
+	return
 }
 
 func (config *Config) Write() {
-	
+
 	// Create file as read/write by user (but does not change perms of existing file)
 	fileToWrite, err := os.OpenFile(config.FilePath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
 	if err != nil {
 		error_handler.ErrorExit(err)
 	}
-	
+
 	enc := json.NewEncoder(fileToWrite)
-    enc.Encode(config.Map)
+	enc.Encode(config.Map)
 }
 
 func (config *Config) Read() {
@@ -48,4 +48,4 @@ func (config *Config) Read() {
 	}
 	dec := json.NewDecoder(fileToRead)
 	dec.Decode(&config.Map)
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/models/access.go
----------------------------------------------------------------------
diff --git a/models/access.go b/models/access.go
index 936f63d..27a7dbb 100644
--- a/models/access.go
+++ b/models/access.go
@@ -3,4 +3,4 @@ package models
 type AccessSummary struct {
 	Links                       map[string]URI `json:"links"`
 	LocationProvisioningAllowed bool           `json:"locationProvisioningAllowed"`
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/models/applications.go
----------------------------------------------------------------------
diff --git a/models/applications.go b/models/applications.go
index fb2c814..cac09dd 100644
--- a/models/applications.go
+++ b/models/applications.go
@@ -10,27 +10,27 @@ type Tree struct {
 }
 
 type TaskSummary struct {
-	SubmitTimeUtc     int64                       `json:"submitTimeUtc"`
-	EndTimeUtc        int64                       `json:"endTimeUtc"`
-	IsCancelled       bool                        `json:"isCancelled"`
-	CurrentStatus     string                      `json:"currentStatus"`
-	BlockingTask      LinkTaskWithMetadata        `json:"blockingTask"`
-	DisplayName       string                      `json:"displayName"`
+	SubmitTimeUtc     int64                              `json:"submitTimeUtc"`
+	EndTimeUtc        int64                              `json:"endTimeUtc"`
+	IsCancelled       bool                               `json:"isCancelled"`
+	CurrentStatus     string                             `json:"currentStatus"`
+	BlockingTask      LinkTaskWithMetadata               `json:"blockingTask"`
+	DisplayName       string                             `json:"displayName"`
 	Streams           map[string]LinkStreamsWithMetadata `json:"streams"`
-	Description       string                      `json:"description"`
-	EntityId          string                      `json:"entityId"`
-	EntityDisplayName string                      `json:"entityDisplayName"`
-	Error             bool                        `json:"error"`
-	SubmittedByTask   LinkTaskWithMetadata        `json:"submittedByTask"`
-	Result            interface{}                 `json:"result"`
-	IsError           bool                        `json:"isError"`
-	DetailedStatus    string                      `json:"detailedStatus"`
-	Children          []LinkTaskWithMetadata      `json:"children"`
-	BlockingDetails   string                      `json:"blockingDetails"`
-	Cancelled         bool                        `json:"cancelled"`
-	Links             map[string]URI              `json:"links"`
-	Id                string                      `json:"id"`
-	StartTimeUtc      int64                       `json:"startTimeUtc"`
+	Description       string                             `json:"description"`
+	EntityId          string                             `json:"entityId"`
+	EntityDisplayName string                             `json:"entityDisplayName"`
+	Error             bool                               `json:"error"`
+	SubmittedByTask   LinkTaskWithMetadata               `json:"submittedByTask"`
+	Result            interface{}                        `json:"result"`
+	IsError           bool                               `json:"isError"`
+	DetailedStatus    string                             `json:"detailedStatus"`
+	Children          []LinkTaskWithMetadata             `json:"children"`
+	BlockingDetails   string                             `json:"blockingDetails"`
+	Cancelled         bool                               `json:"cancelled"`
+	Links             map[string]URI                     `json:"links"`
+	Id                string                             `json:"id"`
+	StartTimeUtc      int64                              `json:"startTimeUtc"`
 }
 
 type ApplicationSummary struct {
@@ -52,26 +52,26 @@ type LinkWithMetadata struct {
 }
 
 type LinkStreamsWithMetadata struct {
-	Link     string              `json:"link"`
-	Metadata LinkStreamMetadata  `json:"metadata"`
+	Link     string             `json:"link"`
+	Metadata LinkStreamMetadata `json:"metadata"`
 }
 
 type LinkStreamMetadata struct {
-	Name     string  `json:"name"`
-	Size     int64   `json:"size"`
-	SizeText string  `json:"sizeText"`
+	Name     string `json:"name"`
+	Size     int64  `json:"size"`
+	SizeText string `json:"sizeText"`
 }
 
 type LinkTaskWithMetadata struct {
-	Link      string            `json:"link"`
-	Metadata  LinkTaskMetadata  `json:"metadata"`
+	Link     string           `json:"link"`
+	Metadata LinkTaskMetadata `json:"metadata"`
 }
 
 type LinkTaskMetadata struct {
-	Id                 string  `json:"id"`
-	TaskName           string  `json:"taskName"`
-	EntityId           string  `json:"entityId"`
-	EntityDisplayName  string  `json:"entityDisplayName"`
+	Id                string `json:"id"`
+	TaskName          string `json:"taskName"`
+	EntityId          string `json:"entityId"`
+	EntityDisplayName string `json:"entityDisplayName"`
 }
 
 type URI string

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/models/catalog.go
----------------------------------------------------------------------
diff --git a/models/catalog.go b/models/catalog.go
index 419fdef..92b745c 100644
--- a/models/catalog.go
+++ b/models/catalog.go
@@ -14,32 +14,30 @@ type CatalogItemSummary struct {
 }
 
 type CatalogPolicySummary struct {
-	symbolicName string         `json:"symbolicName"`  
-    version      string         `json:"version"`  
-    displayName  string         `json:"name"`  
-    javaType     string         `json:"javaType"`  
-    planYaml     string         `json:"planYaml"`  
-    description  string         `json:"description"`  
-    iconUrl      string         `json:"iconUrl"`  
-    deprecated   bool           `json:"deprecated"`  
-    links        map[string]URI `json:"links"` 
+	symbolicName string         `json:"symbolicName"`
+	version      string         `json:"version"`
+	displayName  string         `json:"name"`
+	javaType     string         `json:"javaType"`
+	planYaml     string         `json:"planYaml"`
+	description  string         `json:"description"`
+	iconUrl      string         `json:"iconUrl"`
+	deprecated   bool           `json:"deprecated"`
+	links        map[string]URI `json:"links"`
 }
 
-
 type CatalogLocationSummary struct {
-	
 }
 
 type CatalogEntitySummary struct {
-	symbolicName string                 `json:"symbolicName"`  
-    version      string                 `json:"version"`  
-    displayName  string                 `json:"name"`  
-    javaType     string                 `json:"javaType"`  
-    planYaml     string                 `json:"planYaml"`  
-    description  string                 `json:"description"`
-    Config       []ConfigSummary        `json:"config"`
-    Effectors    []EffectorSummary      `json:"effectors"`
-    Sensors      []SensorSummary        `json:"sensors"`
+	symbolicName string                 `json:"symbolicName"`
+	version      string                 `json:"version"`
+	displayName  string                 `json:"name"`
+	javaType     string                 `json:"javaType"`
+	planYaml     string                 `json:"planYaml"`
+	description  string                 `json:"description"`
+	Config       []ConfigSummary        `json:"config"`
+	Effectors    []EffectorSummary      `json:"effectors"`
+	Sensors      []SensorSummary        `json:"sensors"`
 	Deprecated   bool                   `json:"deprecated"`
 	Links        map[string]interface{} `json:"links"`
 	Id           string                 `json:"id"`

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/models/policies.go
----------------------------------------------------------------------
diff --git a/models/policies.go b/models/policies.go
index 8d48667..16c1b25 100644
--- a/models/policies.go
+++ b/models/policies.go
@@ -9,13 +9,13 @@ type PolicySummary struct {
 }
 
 type PolicyConfigList struct {
-    Name            string          `json:"name"`
-    Type            string          `json:"type"`
-    DefaultValue    interface{}     `json:"defaultValue`
-    Description     string          `json:"description"`
-    Reconfigurable  bool            `json:"reconfigurable"`
-    Label           string          `json:"label"`
-    Priority        int64           `json:"priority"`
-    PossibleValues  []interface{}   `json:"possibleValues"`
-    Links           map[string]URI  `json:"links"`
+	Name           string         `json:"name"`
+	Type           string         `json:"type"`
+	DefaultValue   interface{}    `json:"defaultValue`
+	Description    string         `json:"description"`
+	Reconfigurable bool           `json:"reconfigurable"`
+	Label          string         `json:"label"`
+	Priority       int64          `json:"priority"`
+	PossibleValues []interface{}  `json:"possibleValues"`
+	Links          map[string]URI `json:"links"`
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/models/version.go
----------------------------------------------------------------------
diff --git a/models/version.go b/models/version.go
index 3c14b5f..bc68bf5 100644
--- a/models/version.go
+++ b/models/version.go
@@ -1,17 +1,16 @@
 package models
 
 type VersionSummary struct {
-    Version     string                   `json:"version"`
-    BuildSha1   string                   `json:"buildSha1"`
-    BuildBranch string                   `json:"buildBranch"`
-    Features    []BrooklynFeatureSummary `json:"features"`
+	Version     string                   `json:"version"`
+	BuildSha1   string                   `json:"buildSha1"`
+	BuildBranch string                   `json:"buildBranch"`
+	Features    []BrooklynFeatureSummary `json:"features"`
 }
 
 type BrooklynFeatureSummary struct {
-    Name           string            `json:"name"`
-    SymbolicName   string            `json:"symbolicName"`
-    Version        string            `json:"version"`
-    LastModified   string            `json:"lastModified"`
-    AdditionalData map[string]string `json:"additionalData"`
+	Name           string            `json:"name"`
+	SymbolicName   string            `json:"symbolicName"`
+	Version        string            `json:"version"`
+	LastModified   string            `json:"lastModified"`
+	AdditionalData map[string]string `json:"additionalData"`
 }
-

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/net/net.go
----------------------------------------------------------------------
diff --git a/net/net.go b/net/net.go
index 76ad148..7b49475 100644
--- a/net/net.go
+++ b/net/net.go
@@ -2,16 +2,16 @@ package net
 
 import (
 	"bytes"
+	"encoding/json"
+	"errors"
 	"io"
 	"io/ioutil"
 	"net/http"
 	"net/url"
 	"os"
 	"path/filepath"
-	"errors"
-    "strings"
-    "strconv"
-    "encoding/json"
+	"strconv"
+	"strings"
 )
 
 type Network struct {
@@ -47,31 +47,30 @@ func (net *Network) NewDeleteRequest(url string) *http.Request {
 }
 
 type HttpError struct {
-    Code    int
+	Code    int
 	Status  string
 	Headers http.Header
 	Body    string
 }
 
 func (err HttpError) Error() string {
-    return err.Status
-}
-
-
-func makeError (resp *http.Response, code int, body []byte) error {
-    theError := HttpError {
-        Code:    code,
-        Status:  resp.Status,
-        Headers: resp.Header,
-    }
-    details := make(map[string]string)
-    if err := json.Unmarshal(body, &details); nil == err {
-        if message, ok := details["message"]; ok {
-            theError.Body = message
-            return theError
-        }
-    }
-    theError.Body = string(body)
+	return err.Status
+}
+
+func makeError(resp *http.Response, code int, body []byte) error {
+	theError := HttpError{
+		Code:    code,
+		Status:  resp.Status,
+		Headers: resp.Header,
+	}
+	details := make(map[string]string)
+	if err := json.Unmarshal(body, &details); nil == err {
+		if message, ok := details["message"]; ok {
+			theError.Body = message
+			return theError
+		}
+	}
+	theError.Body = string(body)
 	return theError
 }
 
@@ -83,15 +82,15 @@ func (net *Network) SendRequest(req *http.Request) ([]byte, error) {
 	}
 	defer resp.Body.Close()
 	body, err := ioutil.ReadAll(resp.Body)
-	if code, failed := unsuccessful(resp.Status) ; failed {
+	if code, failed := unsuccessful(resp.Status); failed {
 		return nil, makeError(resp, code, body)
 	}
 	return body, err
 }
 
+const httpSuccessSeriesFrom = 200
+const httpSuccessSeriesTo = 300
 
-const httpSuccessSeriesFrom = 200;
-const httpSuccessSeriesTo = 300;
 func unsuccessful(status string) (int, bool) {
 	tokens := strings.Split(status, " ")
 	if 0 == len(tokens) {

http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/63d33d4a/scope/scope.go
----------------------------------------------------------------------
diff --git a/scope/scope.go b/scope/scope.go
index 8a34fb3..6ecf406 100644
--- a/scope/scope.go
+++ b/scope/scope.go
@@ -1,23 +1,24 @@
 package scope
+
 import (
 	"strings"
 )
 
 type Scope struct {
 	Application string
-	Entity string
-	Effector string
-	Config string
-	Activity string
+	Entity      string
+	Effector    string
+	Config      string
+	Activity    string
 }
 
 func (scope Scope) String() string {
 	return strings.Join([]string{
 		"{Application: ", scope.Application,
-		", Entity: ",scope.Entity,
-		", Effector: ",  scope.Effector,
+		", Entity: ", scope.Entity,
+		", Effector: ", scope.Effector,
 		", Config: ", scope.Config,
-		", Activity: ",  scope.Activity,
+		", Activity: ", scope.Activity,
 		"}",
 	}, "")
 }
@@ -42,26 +43,25 @@ func activity(scope *Scope, id string) {
 	scope.Activity = id
 }
 
-var scopeSpecifier  = map[string] func(scope *Scope, id string) {
-	"application" : application,
-	"app" : application,
-	"a" : application,
-	"entity" : entity,
-	"ent" : entity,
-	"e" : entity,
-	"effector" : effector,
-	"eff" : effector,
-	"f" : effector,
-	"config" : config,
-	"conf" : config,
-	"con" : config,
-	"c" : config,
-	"activity" : activity,
-	"act" : activity,
-	"v" : activity,
+var scopeSpecifier = map[string]func(scope *Scope, id string){
+	"application": application,
+	"app":         application,
+	"a":           application,
+	"entity":      entity,
+	"ent":         entity,
+	"e":           entity,
+	"effector":    effector,
+	"eff":         effector,
+	"f":           effector,
+	"config":      config,
+	"conf":        config,
+	"con":         config,
+	"c":           config,
+	"activity":    activity,
+	"act":         activity,
+	"v":           activity,
 }
 
-
 // Scopes the arguments.
 // Assumes the arguments are a copy of the program args, including the first member that defines the program name.
 // Removes the scope arguments from the array and applies them to a scope object.
@@ -86,33 +86,33 @@ func ScopeArguments(args []string) ([]string, Scope) {
 	return args, scope
 }
 
-func defineScope(args []string, scope *Scope) ([]string) {
+func defineScope(args []string, scope *Scope) []string {
 
-    allScopesFound := false
-    for !allScopesFound && len(args) > 2 && args[1][0] != '-' {
-        if setAppropriateScope, nameOfAScope := scopeSpecifier[args[0]]; nameOfAScope {
-            setAppropriateScope(scope, args[1])
-            args = args[2:]
-        } else {
-            allScopesFound = true
-        }
-    }
+	allScopesFound := false
+	for !allScopesFound && len(args) > 2 && args[1][0] != '-' {
+		if setAppropriateScope, nameOfAScope := scopeSpecifier[args[0]]; nameOfAScope {
+			setAppropriateScope(scope, args[1])
+			args = args[2:]
+		} else {
+			allScopesFound = true
+		}
+	}
 
-    setDefaultEntityIfRequired(scope)
+	setDefaultEntityIfRequired(scope)
 
-    return args
+	return args
 }
 
 func setDefaultEntityIfRequired(scope *Scope) {
-    if "" == scope.Entity {
-        scope.Entity = scope.Application
-    }
+	if "" == scope.Entity {
+		scope.Entity = scope.Application
+	}
 }
 
-func prepend(v string, args[]string) []string {
-	result := make([]string, len(args) + 1)
+func prepend(v string, args []string) []string {
+	result := make([]string, len(args)+1)
 	result[0] = v
-	for i, a := range(args) {
+	for i, a := range args {
 		result[i+1] = a
 	}
 	return result


Mime
View raw message