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

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

Create a proposal to improve this.

As stated above, I would like to see the same error message, regardless whether a flag was given with the deploy command or not:

Expected:

$ hugo deploy --force
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

Actual:

$ 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)
...
...
  -v, --verbose                    verbose output

Error: command error: unknown flag: --force

I meant on GitHub.

I see.

Done, just created new issue 13012 on GitHub.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.