github.com/liamawhite/cli-with-i18n@v6.32.1-0.20171122084555-dede0a5c3448+incompatible/command/v2/ssh_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  type SSHCommand struct {
    12  	RequiredArgs        flag.AppName `positional-args:"yes"`
    13  	AppInstanceIndex    int          `long:"app-instance-index" short:"i" description:"Application instance index (Default: 0)"`
    14  	Command             string       `long:"command" short:"c" description:"Command to run. This flag can be defined more than once."`
    15  	DisablePseudoTTY    bool         `long:"disable-pseudo-tty" short:"T" description:"Disable pseudo-tty allocation"`
    16  	ForcePseudoTTY      bool         `long:"force-pseudo-tty" description:"Force pseudo-tty allocation"`
    17  	LocalPort           string       `short:"L" description:"Local port forward specification. This flag can be defined more than once."`
    18  	RemotePseudoTTY     bool         `long:"request-pseudo-tty" short:"t" description:"Request pseudo-tty allocation"`
    19  	SkipHostValidation  bool         `long:"skip-host-validation" short:"k" description:"Skip host key validation"`
    20  	SkipRemoteExecution bool         `long:"skip-remote-execution" short:"N" description:"Do not execute a remote command"`
    21  	usage               interface{}  `usage:"CF_NAME ssh APP_NAME [-i INDEX] [-c COMMAND]... [-L [BIND_ADDRESS:]PORT:HOST:HOST_PORT] [--skip-host-validation] [--skip-remote-execution] [--disable-pseudo-tty | --force-pseudo-tty | --request-pseudo-tty]"`
    22  	relatedCommands     interface{}  `related_commands:"allow-space-ssh, enable-ssh, space-ssh-allowed, ssh-code, ssh-enabled"`
    23  }
    24  
    25  func (SSHCommand) Setup(config command.Config, ui command.UI) error {
    26  	return nil
    27  }
    28  
    29  func (SSHCommand) Execute(args []string) error {
    30  	cmd.Main(os.Getenv("CF_TRACE"), os.Args)
    31  	return nil
    32  }