From 28f8e61de8061cb377b02e60256e4749674d2af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20L=2E=20Hansen?= Date: Tue, 1 Jun 2021 10:08:22 -0700 Subject: [PATCH] Ensure defaults for booleans is set correctly Fixes #16 --- README.md | 2 +- release-checklist.md | 2 +- utils/flags.go | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 603581c..ec88fa4 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ By default, GoTTY starts a web server at port 8080. Open the URL on your web bro --height value Static height of the screen, 0(default) means dynamically resize (default: 0) [$GOTTY_HEIGHT] --ws-origin value A regular expression that matches origin URLs to be accepted by WebSocket. No cross origin requests are acceptable by default [$GOTTY_WS_ORIGIN] --term value Terminal name to use on the browser, one of xterm or hterm. (default: "xterm") [$GOTTY_TERM] - --enable-webgl Enable WebGL renderer (default: false) [$GOTTY_ENABLE_WEBGL] + --enable-webgl Enable WebGL renderer (default: true) [$GOTTY_ENABLE_WEBGL] --close-signal value Signal sent to the command process when gotty close it (default: SIGHUP) (default: 1) [$GOTTY_CLOSE_SIGNAL] --close-timeout value Time in seconds to force kill process after client is disconnected (default: -1) (default: -1) [$GOTTY_CLOSE_TIMEOUT] --config value Config file path (default: "~/.gotty") [$GOTTY_CONFIG] diff --git a/release-checklist.md b/release-checklist.md index bcb0e56..9920ca1 100644 --- a/release-checklist.md +++ b/release-checklist.md @@ -5,4 +5,4 @@ * Check that cross-compilation works. * Ensure NEWS is up-to-date * Ensure contributor list is up-to-date - * Ensure VERSION is set correctly in Makefile + * Ensure usage is correct in Makefile diff --git a/utils/flags.go b/utils/flags.go index dc24783..f33fec4 100644 --- a/utils/flags.go +++ b/utils/flags.go @@ -46,10 +46,11 @@ func GenerateFlags(options ...interface{}) (flags []cli.Flag, mappings map[strin }) case reflect.Bool: flags = append(flags, &cli.BoolFlag{ - Name: flagName, - Usage: flagDescription, - EnvVars: []string{envName}, - Aliases: aliases, + Name: flagName, + Usage: flagDescription, + EnvVars: []string{envName}, + Aliases: aliases, + DefaultText: field.Tag("default"), }) case reflect.Int: flags = append(flags, &cli.IntFlag{