github.com/liamawhite/cli-with-i18n@v6.32.1-0.20171122084555-dede0a5c3448+incompatible/command/v2/set_env_command.go (about)

     1  package v2
     2  
     3  import (
     4  	"os"
     5  
     6  	"github.com/liamawhite/cli-with-i18n/cf/cmd"
     7  	"github.com/liamawhite/cli-with-i18n/command"
     8  	"github.com/liamawhite/cli-with-i18n/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, unset-env"`
    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  }