summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2018-09-21 14:27:35 +0200
committerBjørn Erik Pedersen <[email protected]>2018-09-21 14:27:35 +0200
commitdf4cbbd3bdc05aa14a67b3a0a29a0db75b82e640 (patch)
tree789b18a5d5ad01ccd6936b993714ba227bf39c87
parent2e2e34a9350edec0220462aa3d47ecc9d428a0fb (diff)
downloadhugo-df4cbbd3bdc05aa14a67b3a0a29a0db75b82e640.tar.gz
hugo-df4cbbd3bdc05aa14a67b3a0a29a0db75b82e640.zip
commands: Remove deprecated flags
-rw-r--r--commands/commands.go4
-rw-r--r--commands/commands_test.go3
-rw-r--r--commands/hugo.go13
3 files changed, 1 insertions, 19 deletions
diff --git a/commands/commands.go b/commands/commands.go
index 17c9e15cc..54eb03b5b 100644
--- a/commands/commands.go
+++ b/commands/commands.go
@@ -220,8 +220,6 @@ func (cc *hugoBuilderCommon) handleFlags(cmd *cobra.Command) {
cmd.Flags().StringP("destination", "d", "", "filesystem path to write files to")
cmd.Flags().StringP("theme", "t", "", "theme to use (located in /themes/THEMENAME/)")
cmd.Flags().StringP("themesDir", "", "", "filesystem path to themes directory")
- cmd.Flags().Bool("uglyURLs", false, "(deprecated) if true, use /filename.html instead of /filename/")
- cmd.Flags().Bool("canonifyURLs", false, "(deprecated) if true, all relative URLs will be canonicalized using baseURL")
cmd.Flags().StringVarP(&cc.baseURL, "baseURL", "b", "", "hostname (and path) to the root, e.g. http://spf13.com/")
cmd.Flags().Bool("enableGitInfo", false, "add Git revision, date and author info to the pages")
cmd.Flags().BoolVar(&cc.gc, "gc", false, "enable to run some cleanup tasks (remove unused cache files) after the build")
@@ -229,8 +227,6 @@ func (cc *hugoBuilderCommon) handleFlags(cmd *cobra.Command) {
cmd.Flags().BoolVar(&nitro.AnalysisOn, "stepAnalysis", false, "display memory and timing of different steps of the program")
cmd.Flags().Bool("templateMetrics", false, "display metrics about template executions")
cmd.Flags().Bool("templateMetricsHints", false, "calculate some improvement hints when combined with --templateMetrics")
- cmd.Flags().Bool("pluralizeListTitles", true, "(deprecated) pluralize titles in lists using inflect")
- cmd.Flags().Bool("preserveTaxonomyNames", false, `(deprecated) preserve taxonomy names as written ("Gérard Depardieu" vs "gerard-depardieu")`)
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")
diff --git a/commands/commands_test.go b/commands/commands_test.go
index 907f003c0..90b2f2c3d 100644
--- a/commands/commands_test.go
+++ b/commands/commands_test.go
@@ -72,7 +72,7 @@ func TestCommandsPersistentFlags(t *testing.T) {
"--port=1366",
"--renderToDisk",
"--source=mysource",
- "--uglyURLs"}, func(commands []cmder) {
+ }, func(commands []cmder) {
var sc *serverCmd
for _, command := range commands {
if b, ok := command.(commandsBuilderGetter); ok {
@@ -105,7 +105,6 @@ func TestCommandsPersistentFlags(t *testing.T) {
assert.Equal([]string{"page", "home"}, cfg.Get("disableKinds"))
- assert.True(cfg.GetBool("uglyURLs"))
assert.True(cfg.GetBool("gc"))
// The flag is named i18n-warnings
diff --git a/commands/hugo.go b/commands/hugo.go
index 3f1697ea9..2e7353d51 100644
--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -233,22 +233,9 @@ func initializeFlags(cmd *cobra.Command, cfg config.Provider) {
}
-var deprecatedFlags = map[string]bool{
- strings.ToLower("uglyURLs"): true,
- strings.ToLower("pluralizeListTitles"): true,
- strings.ToLower("preserveTaxonomyNames"): true,
- strings.ToLower("canonifyURLs"): true,
-}
-
func setValueFromFlag(flags *flag.FlagSet, key string, cfg config.Provider, targetKey string, force bool) {
key = strings.TrimSpace(key)
if (force && flags.Lookup(key) != nil) || flags.Changed(key) {
- if _, deprecated := deprecatedFlags[strings.ToLower(key)]; deprecated {
- msg := fmt.Sprintf(`Set "%s = true" in your config.toml.
-If you need to set this configuration value from the command line, set it via an OS environment variable: "HUGO_%s=true hugo"`, key, strings.ToUpper(key))
- // Remove in Hugo 0.38
- helpers.Deprecated("hugo", "--"+key+" flag", msg, true)
- }
f := flags.Lookup(key)
configKey := key
if targetKey != "" {