How to use terraform-docs with no modules (only root module)?

I have been trying to use terraform-docs with a Terraform sample infrastructure which is not organized into modules, so it only has the root module (as we read in modules docs). I started by installing terraform-docs with go get, according to the instructions on GitHub. The terraform-docs syntax to generate markdown docs is terraform-docs markdown ./my-terraform-module. If I try to pass a .tf file as argument, I get:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x79eb84]

goroutine 1 [running]:
github.com/terraform-docs/terraform-docs/internal/cli.(*cfgreader).exist(0xc000156000, 0xc000156000, 0x2, 0xc000018e80)
    /home/username/go/pkg/mod/github.com/terraform-docs/terraform-docs@v0.10.0-rc.1/internal/cli/reader.go:22 +0xe4
github.com/terraform-docs/terraform-docs/internal/cli.PreRunEFunc.func1(0xc0000b1b80, 0xc00014c1f0, 0x1, 0x1, 0x0, 0x0)
    /home/username/go/pkg/mod/github.com/terraform-docs/terraform-docs@v0.10.0-rc.1/internal/cli/run.go:46 +0x1b9
github.com/spf13/cobra.(*Command).execute(0xc0000b1b80, 0xc00014c1d0, 0x1, 0x1, 0xc0000b1b80, 0xc00014c1d0)
    /home/username/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:831 +0x514
github.com/spf13/cobra.(*Command).ExecuteC(0xc0000b0dc0, 0x43c027, 0xba3e80, 0xc000012090)
    /home/username/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x349
github.com/spf13/cobra.(*Command).Execute(...)
    /home/username/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
github.com/terraform-docs/terraform-docs/cmd.Execute(0x4ae00, 0xc00001e238)
    /home/username/go/pkg/mod/github.com/terraform-docs/terraform-docs@v0.10.0-rc.1/cmd/root.go:24 +0x2b

When I pass the files directory as argument, I get a markdown output containing only the requirements, providers and input section only contains variables and their values. So, I ask: is it possible to use terraform-docs with the root module?

Thanks in advance

Go to Source
Author: rtrigo