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

Unified Diff: cmd/juju/init.go

Issue 7370043: Change the way aliases to subcommands are handled.
Patch Set: Change the way aliases to subcommands are handled. Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cmd/juju/get.go ('k') | cmd/juju/init_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « cmd/juju/get.go ('k') | cmd/juju/init_test.go » ('j') | no next file with comments »

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