MCPcopy Create free account
hub / github.com/cogentcore/core / main

Function main

parse/cmd/parse/parse.go:23–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21var Excludes []string
22
23func main() {
24 var path string
25 var recurse bool
26 var excl string
27
28 parse.LanguageSupport.OpenStandard()
29
30 flag.Usage = func() {
31 fmt.Fprintf(flag.CommandLine.Output(), "Usage of %s:\n", os.Args[0])
32 flag.PrintDefaults()
33 fmt.Fprintf(flag.CommandLine.Output(), "\ne.g., on mac, to run all of the std go files except cmd which is large and slow:\npi -r -ex cmd /usr/local/Cellar/go/1.11.3/libexec/src\n\n")
34 }
35
36 // process command args
37 flag.StringVar(&path, "path", "", "path to open; can be to a directory or a filename within the directory; or just last arg without a flag")
38 flag.BoolVar(&recurse, "r", false, "recursive; apply to subdirectories")
39 flag.StringVar(&excl, "ex", "", "comma-separated list of directory names to exclude, for recursive case")
40 flag.Parse()
41 if path == "" {
42 if flag.NArg() > 0 {
43 path = flag.Arg(0)
44 } else {
45 path = "."
46 }
47 }
48 Excludes = strings.Split(excl, ",")
49
50 // todo: assuming go for now
51 if recurse {
52 DoGoRecursive(path)
53 } else {
54 DoGoPath(path)
55 }
56}
57
58func DoGoPath(path string) {
59 fmt.Printf("Processing path: %v\n", path)

Callers

nothing calls this directly

Calls 6

DoGoRecursiveFunction · 0.85
DoGoPathFunction · 0.85
OpenStandardMethod · 0.80
SplitMethod · 0.80
ParseMethod · 0.65
OutputMethod · 0.45

Tested by

no test coverage detected