Skip to content

Commit 5a9f918

Browse files
committed
add cmd
1 parent 3994d9d commit 5a9f918

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

cmd/main.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"os"
6+
7+
core "github.com/statloc/core"
8+
9+
"cli/internal"
10+
)
11+
12+
func main () {
13+
if len(os.Args) != 2 {
14+
fmt.Println("Error parsing argument: path specified incorrectly")
15+
} else {
16+
path := os.Args[1]
17+
response, err := core.GetStatistics(path)
18+
19+
if err != nil {
20+
fmt.Printf("Path %s is not found\n", path)
21+
}
22+
23+
fmt.Print(internal.GetTable(response.Items))
24+
}
25+
}

0 commit comments

Comments
 (0)