From 3ff226e1df9628091b16934a838c00422372bb7d Mon Sep 17 00:00:00 2001 From: Antoni Sawicki Date: Mon, 26 Oct 2020 01:37:25 -0700 Subject: [PATCH] reverse headed and headless to improve readability --- wrp.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/wrp.go b/wrp.go index 10c577f..9bc7992 100644 --- a/wrp.go +++ b/wrp.go @@ -397,21 +397,16 @@ func (w wrpReq) capture() { // Main... func main() { var addr, fgeom string - var head, headless bool + var headless bool var debug bool var err error flag.StringVar(&addr, "l", ":8080", "Listen address:port, default :8080") - flag.BoolVar(&head, "h", false, "Headed mode - display browser window") + flag.BoolVar(&headless, "h", true, "Headless mode - hide browser window") flag.BoolVar(&debug, "d", false, "Debug ChromeDP") flag.BoolVar(&nodel, "n", false, "Do not free maps and images after use") flag.StringVar(&deftype, "t", "gif", "Image type: gif|png") flag.StringVar(&fgeom, "g", "1152x600x256", "Geometry: width x height x colors, height can be 0 for unlimited") flag.Parse() - if head { - headless = false - } else { - headless = true - } if len(os.Getenv("PORT")) > 0 { addr = ":" + os.Getenv(("PORT")) }