summaryrefslogtreecommitdiffstats
path: root/commands/commandeer.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-27 15:04:36 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-27 16:56:54 +0200
commitf86b5f70a60fc3793bc826f2ccd8dcdd62e26b51 (patch)
tree05cc4ed0e7856dc114787c98689853d195bc291d /commands/commandeer.go
parent3297b395d8d5fadb45b9055e55458967fb9f4a76 (diff)
commands: Move the --format flag to only the commands that support it
Fixes #11022
Diffstat (limited to 'commands/commandeer.go')
-rw-r--r--commands/commandeer.go10
1 files changed, 0 insertions, 10 deletions
diff --git a/commands/commandeer.go b/commands/commandeer.go
index 08f959579..7b0c41652 100644
--- a/commands/commandeer.go
+++ b/commands/commandeer.go
@@ -108,9 +108,6 @@ type rootCommand struct {
buildWatch bool
environment string
- // File format to read or write (TOML, YAML, JSON).
- format string
-
// Common build flags.
baseURL string
gc bool
@@ -408,12 +405,6 @@ func (r *rootCommand) PreRun(cd, runner *simplecobra.Commandeer) error {
if err != nil {
return err
}
- switch r.format {
- case "json", "toml", "yaml":
- // OK
- default:
- return fmt.Errorf("unsupported format %q; must be one of json, toml or yaml", r.format)
- }
loggers.PanicOnWarning.Store(r.panicOnWarning)
r.commonConfigs = lazycache.New[int32, *commonConfig](lazycache.Options{MaxEntries: 5})
@@ -485,7 +476,6 @@ Complete documentation is available at https://gohugo.io/.`
// Configure persistent flags
cmd.PersistentFlags().StringVarP(&r.source, "source", "s", "", "filesystem path to read files relative from")
- cmd.PersistentFlags().StringVar(&r.format, "format", "toml", "preferred file format (toml, yaml or json)")
cmd.PersistentFlags().SetAnnotation("source", cobra.BashCompSubdirsInDir, []string{})
cmd.PersistentFlags().StringP("destination", "d", "", "filesystem path to write files to")
cmd.PersistentFlags().SetAnnotation("destination", cobra.BashCompSubdirsInDir, []string{})