]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
commands: Handle hugo mod get --help
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 29 Jun 2023 06:53:50 +0000 (08:53 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 29 Jun 2023 06:53:50 +0000 (08:53 +0200)
Fixes #11141

commands/mod.go
testscripts/commands/mod.txt

index 36d4a5596f069244e1a9a0f0c5d2e6190120e226..55b8a8e08d4aeae68d12c7ac9bfda08f62e99a14 100644 (file)
@@ -224,7 +224,7 @@ Run "go help get" for more information. All flags available for "go get" is also
                                run: func(ctx context.Context, cd *simplecobra.Commandeer, r *rootCommand, args []string) error {
                                        // We currently just pass on the flags we get to Go and
                                        // need to do the flag handling manually.
-                                       if len(args) == 1 && args[0] == "-h" {
+                                       if len(args) == 1 && args[0] == "-h" || args[0] == "--help" {
                                                return errHelp
                                        }
 
index a2ea0ad24d1e91991b46ae99be83081b77c3fe48..56cea2c001a81ec504cca54b7f78d7ab201bd0df 100644 (file)
@@ -22,6 +22,10 @@ stdout 'Deleted 2\d{2} files from module cache\.'
 cd submod
 hugo mod init testsubmod
 cmpenv go.mod $WORK/golden/go.mod.testsubmod
+hugo mod get -h
+stdout 'hugo mod get \[flags\] \[args\]'
+hugo mod get --help
+stdout 'hugo mod get \[flags\] \[args\]'
 -- hugo.toml --
 title = "Hugo Modules Test"
 [module]