github.com/dcarley/cf-cli@v6.24.1-0.20170220111324-4225ff346898+incompatible/command/v2/set_env_command.go (about)

     1  package v2
     2  
     3  import (
     4  	"os"
     5  
     6  	"code.cloudfoundry.org/cli/cf/cmd"
     7  	"code.cloudfoundry.org/cli/command"
     8  	"code.cloudfoundry.org/cli/command/flag"
     9  )
    10  
    11  // WorkAroundPrefix is the flag in hole emoji
    12  const WorkAroundPrefix = "\U000026f3"
    13  
    14  type SetEnvCommand struct {
    15  	RequiredArgs    flag.SetEnvironmentArgs `positional-args:"yes"`
    16  	usage           interface{}             `usage:"CF_NAME set-env APP_NAME ENV_VAR_NAME ENV_VAR_VALUE"`
    17  	relatedCommands interface{}             `related_commands:"apps, env, restart, set-staging-environment-variable-group, set-running-environment-variable-group"`
    18  }
    19  
    20  func (_ SetEnvCommand) Setup(config command.Config, ui command.UI) error {
    21  	return nil
    22  }
    23  
    24  func (_ SetEnvCommand) Execute(args []string) error {
    25  	//TODO: Be sure to sanitize the WorkAroundPrefix
    26  	cmd.Main(os.Getenv("CF_TRACE"), os.Args)
    27  	return nil
    28  }