Skip to content

Commit

Permalink
fix(cli): 🐛 retain --terminal cli flag for "headless" mode
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Sep 4, 2024
1 parent 75f31b6 commit e1f6f84
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

repos:
- repo: https://github.com/golangci/golangci-lint
rev: v1.59.1
rev: v1.60.3
hooks:
- id: golangci-lint
- repo: https://github.com/compilerla/conventional-pre-commit
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (d ProfileFlags) AfterApply() error {

type HeadlessFlag bool

func (f *HeadlessFlag) BeforeApply() error {
func (f *HeadlessFlag) AfterApply() error {
if os.Getenv("DISPLAY") == "" && !*f {
slog.Warn("DISPLAY not set, running in headless mode by default (specify --terminal to suppress this warning).")

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var CLI struct {
Version cli.VersionCmd `cmd:"" help:"Show the Go Hass Agent version."`
Upgrade cli.UpgradeCmd `cmd:"" help:"Attempt to upgrade from previous version."`
Profile cli.ProfileFlags `help:"Enable profiling."`
Headless *cli.HeadlessFlag `help:"Run without a GUI." default:"false"`
Headless *cli.HeadlessFlag `name:"terminal" help:"Run without a GUI." default:"false"`
AppID string `name:"appid" default:"${defaultAppID}" help:"Specify a custom app id (for debugging)."`
LogLevel string `name:"log-level" enum:"info,debug,trace" default:"info" help:"Set logging level."`
Config cli.ConfigCmd `cmd:"" help:"Configure Go Hass Agent."`
Expand Down

0 comments on commit e1f6f84

Please sign in to comment.