diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-05-17 18:45:23 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-05-17 22:13:29 +0200 |
commit | 8a69ccbb00e7978c6c5d57e353ce178c2b732b07 (patch) | |
tree | b2f4a1438ae504555571b3e71a205c9022ec68b2 /commands/mod.go | |
parent | 7ce033a89d411036e40dbb42325e30e12248bda9 (diff) | |
download | hugo-8a69ccbb00e7978c6c5d57e353ce178c2b732b07.tar.gz hugo-8a69ccbb00e7978c6c5d57e353ce178c2b732b07.zip |
commands: Improve the common build flag handling
Updates #10947
Diffstat (limited to 'commands/mod.go')
-rw-r--r-- | commands/mod.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/mod.go b/commands/mod.go index a0e488ecd..1af1f7431 100644 --- a/commands/mod.go +++ b/commands/mod.go @@ -293,7 +293,8 @@ func (c *modCommands) Run(ctx context.Context, cd *simplecobra.Commandeer, args return nil } -func (c *modCommands) WithCobraCommand(cmd *cobra.Command) error { +func (c *modCommands) Init(cd *simplecobra.Commandeer) error { + cmd := cd.CobraCommand cmd.Short = "Various Hugo Modules helpers." cmd.Long = `Various helpers to help manage the modules in your project's dependency graph. Most operations here requires a Go version installed on your system (>= Go 1.12) and the relevant VCS client (typically Git). @@ -304,7 +305,7 @@ This is not needed if you only operate on modules inside /themes or if you have return nil } -func (c *modCommands) Init(cd, runner *simplecobra.Commandeer) error { +func (c *modCommands) PreRun(cd, runner *simplecobra.Commandeer) error { c.r = cd.Root.Command.(*rootCommand) return nil } |