github.com/cloud-green/juju@v0.0.0-20151002100041-a00291338d3d/cmd/juju/environment/environment.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package environment
     5  
     6  import (
     7  	"github.com/juju/cmd"
     8  	"github.com/juju/loggo"
     9  	"github.com/juju/utils/featureflag"
    10  
    11  	"github.com/juju/juju/cmd/envcmd"
    12  	"github.com/juju/juju/feature"
    13  )
    14  
    15  var logger = loggo.GetLogger("juju.cmd.juju.environment")
    16  
    17  const commandDoc = `
    18  "juju environment" provides commands to interact with the Juju environment.
    19  `
    20  
    21  // NewSuperCommand creates the environment supercommand and registers the
    22  // subcommands that it supports.
    23  func NewSuperCommand() cmd.Command {
    24  	environmentCmd := cmd.NewSuperCommand(cmd.SuperCommandParams{
    25  		Name:        "environment",
    26  		Doc:         commandDoc,
    27  		UsagePrefix: "juju",
    28  		Purpose:     "manage environments",
    29  	})
    30  	environmentCmd.Register(envcmd.Wrap(&GetCommand{}))
    31  	environmentCmd.Register(envcmd.Wrap(&SetCommand{}))
    32  	environmentCmd.Register(envcmd.Wrap(&UnsetCommand{}))
    33  	environmentCmd.Register(&JenvCommand{})
    34  	environmentCmd.Register(envcmd.Wrap(&RetryProvisioningCommand{}))
    35  	environmentCmd.Register(envcmd.Wrap(&EnvSetConstraintsCommand{}))
    36  	environmentCmd.Register(envcmd.Wrap(&EnvGetConstraintsCommand{}))
    37  
    38  	if featureflag.Enabled(feature.JES) {
    39  		environmentCmd.Register(envcmd.Wrap(&ShareCommand{}))
    40  		environmentCmd.Register(envcmd.Wrap(&UnshareCommand{}))
    41  		environmentCmd.Register(envcmd.Wrap(&UsersCommand{}))
    42  		environmentCmd.Register(envcmd.Wrap(&DestroyCommand{}))
    43  	}
    44  	return environmentCmd
    45  }