Skip to content

Commit

Permalink
commands: Handle hugo mod get --help
Browse files Browse the repository at this point in the history
Fixes #11141
  • Loading branch information
bep committed Jun 29, 2023
1 parent 58e09cc commit 80ecb95
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion commands/mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 4 additions & 0 deletions testscripts/commands/mod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 80ecb95

Please sign in to comment.