From 13216ffa54f0037b62d5680cf1e54d933b149d77 Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Fri, 12 Oct 2018 16:38:04 -0400 Subject: [PATCH] cmd/present: address minor comments not applied in a previous change These changes were suggested in golang.org/cl/140841 but were not applied in that change. They are small documentation fixes and a switch from using fmt.Fprintf/os.Exit to log.Fatalf. Change-Id: I9393261f8f28b589678866dd7b8904d46629fb4b Reviewed-on: https://go-review.googlesource.com/c/141685 Reviewed-by: Andrew Gerrand --- cmd/present/main.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/present/main.go b/cmd/present/main.go index a400f1d9..1fb7fa1e 100644 --- a/cmd/present/main.go +++ b/cmd/present/main.go @@ -25,7 +25,7 @@ var ( originHost = flag.String("orighost", "", "host component of web origin URL (e.g., 'localhost')") basePath = flag.String("base", "", "base path for slide template and static resources") contentPath = flag.String("content", ".", "base path for presentation content") - usePlayground = flag.Bool("use_playground", false, "if false, arbitrary code (Go, shell scripts, etc.) is run locally via WebSocket transport; otherwise it uses play.golang.org") + usePlayground = flag.Bool("use_playground", false, "run code snippets using play.golang.org; if false, run them locally and deliver results by WebSocket transport") nativeClient = flag.Bool("nacl", false, "use Native Client environment playground (prevents non-Go code execution) when using local WebSocket transport") ) @@ -43,8 +43,7 @@ func main() { *httpAddr = fmt.Sprintf("0.0.0.0:%s", port) pwd, err := os.Getwd() if err != nil { - fmt.Fprintf(os.Stderr, "Couldn't get pwd: %v\n", err) - os.Exit(1) + log.Fatalf("Couldn't get pwd: %v\n", err) } *basePath = pwd *usePlayground = true @@ -139,7 +138,7 @@ const localhostWarning = ` WARNING! WARNING! WARNING! The present server appears to be listening on an address that is not localhost -and using socket transport for running Go code. Anyone with access to this address +and is configured to run code snippets locally. Anyone with access to this address and port will have access to this machine as the user running present. To avoid this message, listen on localhost, run with -play=false, or run with