Index: cmd/juju/init.go |
=== renamed file 'cmd/juju/generateconfig.go' => 'cmd/juju/init.go' |
--- cmd/juju/generateconfig.go 2013-02-19 00:11:52 +0000 |
+++ cmd/juju/init.go 2013-02-24 22:26:04 +0000 |
@@ -8,26 +8,30 @@ |
"os" |
) |
-// GenerateConfigCommand is used to write out a boilerplate environments.yaml file. |
-type GenerateConfigCommand struct { |
+// InitCommand is used to write out a boilerplate environments.yaml file. |
+type InitCommand struct { |
WriteFile bool |
} |
-func (c *GenerateConfigCommand) Info() *cmd.Info { |
- return &cmd.Info{"generate-config", "", "generate boilerplate configuration for juju environments", ""} |
+func (c *InitCommand) Info() *cmd.Info { |
+ return &cmd.Info{ |
+ Name: "init", |
+ Purpose: "generate boilerplate configuration for juju environments", |
+ Aliases: []string{"generate-config"}, |
+ } |
} |
-func (c *GenerateConfigCommand) SetFlags(f *gnuflag.FlagSet) { |
+func (c *InitCommand) SetFlags(f *gnuflag.FlagSet) { |
f.BoolVar(&c.WriteFile, "w", false, "write to environments.yaml file if it doesn't already exist") |
} |
-func (c *GenerateConfigCommand) Init(args []string) error { |
+func (c *InitCommand) Init(args []string) error { |
return cmd.CheckEmpty(args) |
} |
// Run checks to see if there is already an environments.yaml file. In one does not exist already, |
// a boilerplate version is created so that the user can edit it to get started. |
-func (c *GenerateConfigCommand) Run(context *cmd.Context) error { |
+func (c *InitCommand) Run(context *cmd.Context) error { |
out := context.Stdout |
config := environs.BoilerplateConfig() |
if !c.WriteFile { |