Files
terraform-docs/internal/cli/annotations.go
Khosrow Moossavi 04a9ef49eb refactor: Refactor cli implemention and configuration (#266)
* Refactor cli implemention and configuration

* cleanup
2020-05-20 22:21:19 -04:00

17 lines
375 B
Go

package cli
import (
"strings"
)
// Annotations returns set of annotations for cobra.Commands,
// specifically the 'command' namd and command 'kind'
func Annotations(cmd string) map[string]string {
annotations := make(map[string]string)
for _, s := range strings.Split(cmd, " ") {
annotations["command"] = s
}
annotations["kind"] = "formatter"
return annotations
}