~dave-cheney/juju-core/102-cmd-init-context

« back to all changes in this revision

Viewing changes to cmd/juju/set.go

  • Committer: Dave Cheney
  • Date: 2012-09-18 11:37:18 UTC
  • Revision ID: david.cheney@canonical.com-20120918113718-nf0nt6m9s4zskh50
add context to command.init

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
        EnvName     string
15
15
        ServiceName string
16
16
        Options     []Option
17
 
        ConfPath    string
 
17
        Config      cmd.FileVar
18
18
}
19
19
 
20
20
type Option struct {
25
25
        return &cmd.Info{"set", "", "set service config options", ""}
26
26
}
27
27
 
28
 
func (c *SetCommand) Init(f *gnuflag.FlagSet, args []string) error {
 
28
func (c *SetCommand) Init(f *gnuflag.FlagSet, args []string, ctx *cmd.Context) error {
29
29
        addEnvironFlags(&c.EnvName, f)
30
 
        f.StringVar(&c.ConfPath, "config", "", "path to yaml-formatted service config")
 
30
        c.Config.AddFlags(f, "config", "path to yaml-formatted service config", ctx)
31
31
        if err := f.Parse(true, args); err != nil {
32
32
                return err
33
33
        }