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]:*cfgreader).exist(0xc000156000, 0xc000156000, 0x2, 0xc000018e80)
    /home/username/go/pkg/mod/ +0xe4, 0xc00014c1f0, 0x1, 0x1, 0x0, 0x0)
    /home/username/go/pkg/mod/ +0x1b9*Command).execute(0xc0000b1b80, 0xc00014c1d0, 0x1, 0x1, 0xc0000b1b80, 0xc00014c1d0)
    /home/username/go/pkg/mod/ +0x514*Command).ExecuteC(0xc0000b0dc0, 0x43c027, 0xba3e80, 0xc000012090)
    /home/username/go/pkg/mod/ +0x349*Command).Execute(...)
    /home/username/go/pkg/mod/, 0xc00001e238)
    /home/username/go/pkg/mod/ +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