-
Notifications
You must be signed in to change notification settings - Fork 31
/
main.go
32 lines (29 loc) · 1009 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Package main contains the main goroutine for the autodoc command-line
// application. This application uses the autodoc engine to create mkdocs
// style documentation for the Terraform provider.
//
// For more information on the autodoc tool, its arguments, etc see:
// pkg/github.com/HanseMerkur/terraform-provider-utils/autodoc
package main
import (
"fmt"
"os"
"github.com/HanseMerkur/terraform-provider-utils/autodoc"
"github.com/terraform-coop/terraform-provider-foreman/foreman"
)
func main() {
// Use the provider function to get information on the provider's schema,
// resources, and data sources. The Provider() function returns a
// *terraform.ResourceProvider (interface) which will need to be type asserted
// to a *schema.Provider (struct)
provider := foreman.Provider()
// Start the autodoc engine
errors := autodoc.Document(provider)
if len(errors) != 0 {
for _, err := range errors {
fmt.Println(err)
}
os.Exit(autodoc.ExitError)
}
os.Exit(autodoc.ExitSuccess)
}