MCPcopy
hub / github.com/esm-dev/esm.sh / Run

Function Run

cli/cli.go:21–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19`
20
21func Run() {
22 if len(os.Args) < 2 {
23 fmt.Print(helpMessage)
24 return
25 }
26 switch command := os.Args[1]; command {
27 case "add":
28 Add()
29 case "tidy":
30 Tidy()
31 case "version":
32 fmt.Println("esm.sh CLI " + VERSION)
33 default:
34 for _, arg := range os.Args[1:] {
35 if arg == "--version" {
36 fmt.Println("esm.sh CLI " + VERSION)
37 return
38 }
39 if arg == "-v" {
40 fmt.Println(VERSION)
41 return
42 }
43 }
44 fmt.Print(helpMessage)
45 }
46}

Callers 1

mainFunction · 0.92

Calls 2

AddFunction · 0.85
TidyFunction · 0.85

Tested by

no test coverage detected