Add clarifying comments for negating `-i` or `-t`

This commit is contained in:
Mahmood Ali 2019-05-15 10:35:12 -04:00
parent 513303347c
commit 1104827671
1 changed files with 6 additions and 2 deletions

View File

@ -44,10 +44,11 @@ Exec Specific Options:
Use a random allocation from the specified job ID.
-i
Pass stdin to the container, defaults to true
Pass stdin to the container, defaults to true. Pass -i=false to disable.
-t
Allocate a pseudo-tty, defaults to true if stdin is detected to be a tty session
Allocate a pseudo-tty, defaults to true if stdin is detected to be a tty session.
Pass -t=false to disable explicitly.
`
return strings.TrimSpace(helpText)
}
@ -215,6 +216,9 @@ func isStdinTty() bool {
return isTerminal
}
// setRawTerminal sets the stream terminal in raw mode, so process captures
// Ctrl+C and other commands to forward to remote process.
// It returns a cleanup function that restores terminal to original mode.
func setRawTerminal(stream interface{}) (cleanup func(), err error) {
fd, isTerminal := term.GetFdInfo(stream)
if !isTerminal {