Skip to content

Commit

Permalink
Document behaviour of the pty options in the usage screen
Browse files Browse the repository at this point in the history
  • Loading branch information
1player committed Jan 14, 2023
1 parent 4f85e3e commit 1a7f84e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,19 @@ func parseArguments() {
If COMMAND is not set, spawn a shell on the host.
Accepted options:
`
const USAGE_FOOTER = `--
If neither pty option is passed, default to allocating a pseudo-terminal unless
the command is known for misbehaving when attached to a pty.
For more details visit https://github.com/1player/host-spawn/issues/12
`

flag.Usage = func() {
fmt.Fprintf(os.Stderr, USAGE_PREAMBLE, os.Args[0])
flag.PrintDefaults()
fmt.Fprintf(os.Stderr, USAGE_FOOTER)
os.Exit(0)
}

Expand Down Expand Up @@ -173,7 +181,7 @@ func main() {
command = append([]string{basename}, os.Args[1:]...)
}

// Lookup if this is a blacklisted program, where we won't enable pty.
// Lookup if this is a blocklisted program, where we won't enable pty.
allocatePty := !blocklist[command[0]]
if *flagPty {
allocatePty = true
Expand Down

0 comments on commit 1a7f84e

Please sign in to comment.