gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
76.03k stars 7.54k forks source link

Hugo 0.137.0: misleading error message when running hugo deploy with flag #13012

Closed deining closed 2 weeks ago

deining commented 2 weeks ago

From this discussion on hugo discourse:

Just tested newly released hugo version 0.137.0 and came across this issue:

$ hugo deploy
Error: deploy not supported in this version of Hugo;
install a release with 'withdeploy' in the archive filename
or build yourself with the 'withdeploy' build tag.
Also see https://github.com/gohugoio/hugo/pull/12995

So far so good.

Output is different and misleading as soon as you specify a flag (e.g. --force) together with the command. IMHO, the error message should be the same, but it isn't:

$ hugo deploy --force
Usage:
  hugo deploy [flags] [args]

Flags:
  -h, --help   help for deploy

Global Flags:
      --clock string               set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
      --config string              config file (default is hugo.yaml|json|toml)
      --configDir string           config dir (default "config")
      --debug                      debug output
  -d, --destination string         filesystem path to write files to
  -e, --environment string         build environment
      --ignoreVendorPaths string   ignores any _vendor for module paths matching the given Glob pattern
      --logLevel string            log level (debug|info|warn|error)
      --quiet                      build in quiet mode
  -M, --renderToMemory             render to memory (mostly useful when running the server)
  -s, --source string              filesystem path to read files relative from
      --themesDir string           filesystem path to themes directory
  -v, --verbose                    verbose output

Error: command error: unknown flag: --force