Skip to content

Commit

Permalink
Support BOSH_TTY environment variable for --tty flag
Browse files Browse the repository at this point in the history
This is convenient for CI/CD tools that may not run jobs in a tty.
See actions/runner#241
  • Loading branch information
leosco committed Oct 4, 2024
1 parent 1a367b9 commit 12b3c40
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/completion/completion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ var globalFlags = []string{
"-n\tDon't ask for user input, env: BOSH_NON_INTERACTIVE",
"--parallel\tThe max number of parallel operations",
"--sha2\tUse SHA256 checksums, env: BOSH_SHA2",
"--tty\tForce TTY-like output",
"--tty\tForce TTY-like output, env: BOSH_TTY",
"--version\tShow CLI version",
"-v\tShow CLI version",
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/opts/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type BoshOpts struct {
// Output formatting
ColumnOpt []ColumnOpt `long:"column" description:"Filter to show only given column(s), use the --column flag for each column you wish to include"`
JSONOpt bool `long:"json" description:"Output as JSON"`
TTYOpt bool `long:"tty" description:"Force TTY-like output"`
TTYOpt bool `long:"tty" description:"Force TTY-like output" env:"BOSH_TTY"`
NoColorOpt bool `long:"no-color" description:"Toggle colorized output"`
NonInteractiveOpt bool `long:"non-interactive" short:"n" description:"Don't ask for user input" env:"BOSH_NON_INTERACTIVE"`

Expand Down
2 changes: 1 addition & 1 deletion cmd/opts/opts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ var _ = Describe("Opts", func() {
Describe("TTYOpt", func() {
It("contains desired values", func() {
Expect(getStructTagForName("TTYOpt", opts)).To(Equal(
`long:"tty" description:"Force TTY-like output"`,
`long:"tty" description:"Force TTY-like output" env:"BOSH_TTY"`,
))
})
})
Expand Down

0 comments on commit 12b3c40

Please sign in to comment.