Hugo modules with `-h` in the name not working

I have a theme that I am trying to move to modules. It is currently hosted at github.com/atishay/eclectic-hugo-theme

When I use hugo mod get github.com/atishay/eclectic-hugo-theme or hugo mod get "github.com/atishay/eclectic-hugo-theme" I am getting the output as if I am typing hugo mod get -h
How do we pass dashes to the Hugo command line? I am on MacOS using zsh.

It works if I use hugo mod get github.com/atishay/eclecticThemeHugo

Looks like you should open an issue for that on Github. That’s definitely a bug not a wanted behaviour.

Did you try a backslash before the dash? like hugo mod get github.com/atishay/eclectic\-hugo\-theme ? In linux systems the backslash tends to make the following character literal.

Filed https://github.com/gohugoio/hugo/issues/6197

That is an odd issue, but I guess hugo mod get is a little special as we just transfer the flags to Go.

That said, the only time I think you’d want to run hugo mod get is when you want to update to never versions of a module. And then you’d typically do hugo mod get -u go update all or hugo mod get -u some-mod to update one. If you just add a new module to config.toml Hugo will “auto get” it.

That said, I’ll fix the reported issue.