Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AwsCommand = &cli.Command{ Name: "aws", Description: "Open hashicorp/aws's docs", Flags: []cli.Flag{ &cli.StringFlag{ Name: "type", Value: "resources", Usage: "resources or data-sources. default is resources.", }, }, Action: func(cCtx *cli.Context) error { tfType := cCtx.String("type") var list []string switch tfType { case "resources": list = tfdocsfinder.AwsResources case "data-sources": list = tfdocsfinder.AwsDataSources default: return cli.Exit(fmt.Errorf("invalid type: %s", tfType), 1) } idx, err := fuzzyfinder.Find(list, func(i int) string { return list[i] }) if err != nil { return nil } fmt.Println(list[idx]) url := fmt.Sprintf("https://registry.terraform.io/providers/hashicorp/aws/latest/docs/%s/%s", tfType, strings.TrimPrefix(list[idx], "aws_")) if err := openBrowser(url); err != nil { return cli.Exit(err, 1) } return nil }, }
View Source
var GitHubCommand = &cli.Command{ Name: "github", Description: "Open integrations/github's docs", Flags: []cli.Flag{ &cli.StringFlag{ Name: "type", Value: "resources", Usage: "resources or data-sources. default is resources.", }, }, Action: func(cCtx *cli.Context) error { tfType := cCtx.String("type") var list []string switch tfType { case "resources": list = tfdocsfinder.GitHubResources case "data-sources": list = tfdocsfinder.GitHubDataSources default: return cli.Exit(fmt.Errorf("invalid type: %s", tfType), 1) } idx, err := fuzzyfinder.Find(list, func(i int) string { return list[i] }) if err != nil { return nil } fmt.Println(list[idx]) url := fmt.Sprintf("https://registry.terraform.io/providers/integrations/github/latest/docs/%s/%s", tfType, strings.TrimPrefix(list[idx], "github_")) if err := openBrowser(url); err != nil { return cli.Exit(err, 1) } return nil }, }
View Source
var GoogleCommand = &cli.Command{ Name: "google", Description: "Open hashicorp/google's docs", Flags: []cli.Flag{ &cli.StringFlag{ Name: "type", Value: "resources", Usage: "resources or data-sources. default is resources.", }, }, Action: func(cCtx *cli.Context) error { tfType := cCtx.String("type") var list []string switch tfType { case "resources": list = tfdocsfinder.GoogleResources case "data-sources": list = tfdocsfinder.GoogleDataSources default: return cli.Exit(fmt.Errorf("invalid type: %s", tfType), 1) } idx, err := fuzzyfinder.Find(list, func(i int) string { return list[i] }) if err != nil { return nil } fmt.Println(list[idx]) url := fmt.Sprintf("https://registry.terraform.io/providers/hashicorp/google/latest/docs/%s/%s", tfType, strings.TrimPrefix(list[idx], "google_")) if err := openBrowser(url); err != nil { return cli.Exit(err, 1) } return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.