MCPcopy Index your code
hub / github.com/dnote/dnote / Execute

Function Execute

pkg/server/cmd/root.go:37–57  ·  view source on GitHub ↗

Execute is the main entry point for the CLI

()

Source from the content-addressed store, hash-verified

35
36// Execute is the main entry point for the CLI
37func Execute() {
38 if len(os.Args) < 2 {
39 rootCmd()
40 return
41 }
42
43 cmd := os.Args[1]
44
45 switch cmd {
46 case "start":
47 startCmd(os.Args[2:])
48 case "user":
49 userCmd(os.Args[2:])
50 case "version":
51 versionCmd()
52 default:
53 fmt.Printf("Unknown command %s\n", cmd)
54 rootCmd()
55 os.Exit(1)
56 }
57}

Callers 1

mainFunction · 0.92

Calls 4

rootCmdFunction · 0.85
startCmdFunction · 0.85
userCmdFunction · 0.85
versionCmdFunction · 0.85

Tested by

no test coverage detected