From eaa42a87546e470402c42d52116c1722fae61ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 30 May 2024 11:35:02 +0200 Subject: [PATCH] commands: Add shorthand flags -M (--renderToMemory) and -N (--navigateToChanged) Closes #12530 --- commands/commandeer.go | 2 +- commands/server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/commandeer.go b/commands/commandeer.go index 5d4f02a4d..59fe32f74 100644 --- a/commands/commandeer.go +++ b/commands/commandeer.go @@ -506,7 +506,7 @@ Complete documentation is available at https://gohugo.io/.` cmd.PersistentFlags().StringVar(&r.cfgDir, "configDir", "config", "config dir") _ = cmd.MarkFlagDirname("configDir") cmd.PersistentFlags().BoolVar(&r.quiet, "quiet", false, "build in quiet mode") - cmd.PersistentFlags().BoolVar(&r.renderToMemory, "renderToMemory", false, "render to memory (mostly useful when running the server)") + cmd.PersistentFlags().BoolVarP(&r.renderToMemory, "renderToMemory", "M", false, "render to memory (mostly useful when running the server)") cmd.PersistentFlags().BoolVarP(&r.verbose, "verbose", "v", false, "verbose output") cmd.PersistentFlags().BoolVarP(&r.debug, "debug", "", false, "debug output") diff --git a/commands/server.go b/commands/server.go index 5832c83d8..6d64a38c6 100644 --- a/commands/server.go +++ b/commands/server.go @@ -538,7 +538,7 @@ of a second, you will be able to save and see your changes nearly instantly.` cmd.Flags().BoolVar(&c.noHTTPCache, "noHTTPCache", false, "prevent HTTP caching") cmd.Flags().BoolVarP(&c.serverAppend, "appendPort", "", true, "append port to baseURL") cmd.Flags().BoolVar(&c.disableLiveReload, "disableLiveReload", false, "watch without enabling live browser reload on rebuild") - cmd.Flags().BoolVar(&c.navigateToChanged, "navigateToChanged", false, "navigate to changed content file on live browser reload") + cmd.Flags().BoolVarP(&c.navigateToChanged, "navigateToChanged", "N", false, "navigate to changed content file on live browser reload") cmd.Flags().BoolVar(&c.renderStaticToDisk, "renderStaticToDisk", false, "serve static files from disk and dynamic files from memory") cmd.Flags().BoolVar(&c.disableFastRender, "disableFastRender", false, "enables full re-renders on changes") cmd.Flags().BoolVar(&c.disableBrowserError, "disableBrowserError", false, "do not show build errors in the browser")