MCPcopy Create free account
hub / github.com/JordanCoin/codemap / RunConfig

Function RunConfig

cmd/config.go:37–56  ·  view source on GitHub ↗

RunConfig dispatches the "config" subcommand.

(subCmd, root string)

Source from the content-addressed store, hash-verified

35
36// RunConfig dispatches the "config" subcommand.
37func RunConfig(subCmd, root string) {
38 absRoot, err := filepath.Abs(root)
39 if err != nil {
40 fmt.Fprintf(os.Stderr, "Error: %v\n", err)
41 os.Exit(1)
42 }
43
44 switch subCmd {
45 case "init":
46 configInit(absRoot)
47 case "show":
48 configShow(absRoot)
49 default:
50 fmt.Fprintln(os.Stderr, "Usage: codemap config <init|show> [path]")
51 fmt.Fprintln(os.Stderr)
52 fmt.Fprintln(os.Stderr, " init Create .codemap/config.json with auto-detected extensions")
53 fmt.Fprintln(os.Stderr, " show Display current project config")
54 os.Exit(1)
55 }
56}
57
58func configInit(root string) {
59 result, err := initProjectConfig(root)

Callers 2

mainFunction · 0.92
TestRunConfigInitAndShowFunction · 0.85

Calls 2

configInitFunction · 0.85
configShowFunction · 0.85

Tested by 1

TestRunConfigInitAndShowFunction · 0.68