Skip to content

Commit

Permalink
commands: Rename --i18n-warnings to printI18nWarnings
Browse files Browse the repository at this point in the history
To get it in line with the others.
  • Loading branch information
bep committed Feb 15, 2022
1 parent 6819fea commit 837fdfd
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion commands/commands.go
Expand Up @@ -304,7 +304,7 @@ func (cc *hugoBuilderCommon) handleFlags(cmd *cobra.Command) {
cmd.Flags().BoolP("forceSyncStatic", "", false, "copy all files when static is changed.")
cmd.Flags().BoolP("noTimes", "", false, "don't sync modification time of files")
cmd.Flags().BoolP("noChmod", "", false, "don't sync permission mode of files")
cmd.Flags().BoolP("i18n-warnings", "", false, "print missing translations")
cmd.Flags().BoolP("printI18nWarnings", "", false, "print missing translations")
cmd.Flags().BoolP("printPathWarnings", "", false, "print warnings on duplicate target paths etc.")
cmd.Flags().StringVarP(&cc.cpuprofile, "profile-cpu", "", "", "write cpu profile to `file`")
cmd.Flags().StringVarP(&cc.memprofile, "profile-mem", "", "", "write memory profile to `file`")
Expand Down
4 changes: 2 additions & 2 deletions commands/commands_test.go
Expand Up @@ -190,7 +190,7 @@ func TestFlags(t *testing.T) {
"--navigateToChanged",
"--disableLiveReload",
"--noHTTPCache",
"--i18n-warnings",
"--printI18nWarnings",
"--destination=/tmp/mydestination",
"-b=https://example.com/b/",
"--port=1366",
Expand Down Expand Up @@ -223,7 +223,7 @@ func TestFlags(t *testing.T) {
// The flag is named printPathWarnings
c.Assert(cfg.GetBool("logPathWarnings"), qt.Equals, true)

// The flag is named i18n-warnings
// The flag is named printI18nWarnings
c.Assert(cfg.GetBool("logI18nWarnings"), qt.Equals, true)
},
},
Expand Down
4 changes: 2 additions & 2 deletions commands/hugo.go
Expand Up @@ -216,7 +216,7 @@ func initializeFlags(cmd *cobra.Command, cfg config.Provider) {
"dryRun",
"force",
"gc",
"i18n-warnings",
"printI18nWarnings",
"invalidateCDN",
"layoutDir",
"logFile",
Expand All @@ -243,7 +243,7 @@ func initializeFlags(cmd *cobra.Command, cfg config.Provider) {

// Set some "config aliases"
setValueFromFlag(cmd.Flags(), "destination", cfg, "publishDir", false)
setValueFromFlag(cmd.Flags(), "i18n-warnings", cfg, "logI18nWarnings", false)
setValueFromFlag(cmd.Flags(), "printI18nWarnings", cfg, "logI18nWarnings", false)
setValueFromFlag(cmd.Flags(), "printPathWarnings", cfg, "logPathWarnings", false)
}

Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/commands/hugo.md
Expand Up @@ -40,7 +40,6 @@ hugo [flags]
--forceSyncStatic copy all files when static is changed.
--gc enable to run some cleanup tasks (remove unused cache files) after the build
-h, --help help for hugo
--i18n-warnings print missing translations
--ignoreCache ignores the cache directory
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
-l, --layoutDir string filesystem path to layout directory
Expand All @@ -51,6 +50,7 @@ hugo [flags]
--noTimes don't sync modification time of files
--panicOnWarning panic on first WARNING log
--poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
--printI18nWarnings print missing translations
--printMemoryUsage print memory usage to screen at intervals
--printPathWarnings print warnings on duplicate target paths etc.
--quiet build in quiet mode
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/commands/hugo_mod.md
Expand Up @@ -39,14 +39,14 @@ See https://gohugo.io/hugo-modules/ for more information.
--forceSyncStatic copy all files when static is changed.
--gc enable to run some cleanup tasks (remove unused cache files) after the build
-h, --help help for mod
--i18n-warnings print missing translations
--ignoreCache ignores the cache directory
-l, --layoutDir string filesystem path to layout directory
--minify minify any supported output format (HTML, XML etc.)
--noChmod don't sync permission mode of files
--noTimes don't sync modification time of files
--panicOnWarning panic on first WARNING log
--poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
--printI18nWarnings print missing translations
--printMemoryUsage print memory usage to screen at intervals
--printPathWarnings print warnings on duplicate target paths etc.
--templateMetrics display metrics about template executions
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/commands/hugo_new.md
Expand Up @@ -39,7 +39,6 @@ hugo new [path] [flags]
--forceSyncStatic copy all files when static is changed.
--gc enable to run some cleanup tasks (remove unused cache files) after the build
-h, --help help for new
--i18n-warnings print missing translations
--ignoreCache ignores the cache directory
-k, --kind string content type to create
-l, --layoutDir string filesystem path to layout directory
Expand All @@ -48,6 +47,7 @@ hugo new [path] [flags]
--noTimes don't sync modification time of files
--panicOnWarning panic on first WARNING log
--poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
--printI18nWarnings print missing translations
--printMemoryUsage print memory usage to screen at intervals
--printPathWarnings print warnings on duplicate target paths etc.
--templateMetrics display metrics about template executions
Expand Down
2 changes: 1 addition & 1 deletion docs/content/en/commands/hugo_server.md
Expand Up @@ -47,7 +47,6 @@ hugo server [flags]
--forceSyncStatic copy all files when static is changed.
--gc enable to run some cleanup tasks (remove unused cache files) after the build
-h, --help help for server
--i18n-warnings print missing translations
--ignoreCache ignores the cache directory
-l, --layoutDir string filesystem path to layout directory
--liveReloadPort int port for live reloading (i.e. 443 in HTTPS proxy situations) (default -1)
Expand All @@ -61,6 +60,7 @@ hugo server [flags]
--panicOnWarning panic on first WARNING log
--poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
-p, --port int port on which the server will listen (default 1313)
--printI18nWarnings print missing translations
--printMemoryUsage print memory usage to screen at intervals
--printPathWarnings print warnings on duplicate target paths etc.
--renderToDisk render to Destination path (default is render to memory & serve from there)
Expand Down

1 comment on commit 837fdfd

@theperiscope
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the consistency, it is also breaking change for CI/CD pipelines -- I would love to see marking options as obsolete first in some way (perhaps a warning during build?) for certain amount of time before removing to avoid issues like one below.
giuliov/hugo-vsts-extension#23

Please sign in to comment.