MCPcopy Index your code
hub / github.com/cloudfoundry/cli / EvaluateTTYOption

Method EvaluateTTYOption

command/v7/ssh_command.go:103–127  ·  view source on GitHub ↗

EvaluateTTYOption determines which TTY options are mutually exclusive and returns an error accordingly.

()

Source from the content-addressed store, hash-verified

101// EvaluateTTYOption determines which TTY options are mutually exclusive and
102// returns an error accordingly.
103func (cmd SSHCommand) EvaluateTTYOption() (sharedaction.TTYOption, error) {
104 var count int
105
106 option := sharedaction.RequestTTYAuto
107 if cmd.DisablePseudoTTY {
108 option = sharedaction.RequestTTYNo
109 count++
110 }
111 if cmd.ForcePseudoTTY {
112 option = sharedaction.RequestTTYForce
113 count++
114 }
115 if cmd.RequestPseudoTTY {
116 option = sharedaction.RequestTTYYes
117 count++
118 }
119
120 if count > 1 {
121 return option, translatableerror.ArgumentCombinationError{Args: []string{
122 "--disable-pseudo-tty", "-T", "--force-pseudo-tty", "--request-pseudo-tty", "-t",
123 }}
124 }
125
126 return option, nil
127}

Callers 2

ExecuteMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected