MCPcopy
hub / github.com/hashicorp/hcl / realmain

Function realmain

cmd/hclfmt/main.go:53–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51}
52
53func realmain() error {
54 flag.Usage = usage
55 flag.Parse()
56
57 if *showVersion {
58 fmt.Println(versionStr)
59 return nil
60 }
61
62 err := processFiles()
63 if err != nil {
64 return err
65 }
66
67 if checkErrs {
68 return errors.New("one or more files contained errors")
69 }
70
71 if *reqNoChange {
72 if len(changed) != 0 {
73 return fmt.Errorf("file(s) were changed: %s", strings.Join(changed, ", "))
74 }
75 }
76
77 return nil
78}
79
80func processFiles() error {
81 if flag.NArg() == 0 {

Callers 1

mainFunction · 0.70

Calls 2

processFilesFunction · 0.85
JoinMethod · 0.80

Tested by

no test coverage detected