-
-
Notifications
You must be signed in to change notification settings - Fork 369
Expand file tree
/
Copy pathtracks.go
More file actions
38 lines (32 loc) · 749 Bytes
/
tracks.go
File metadata and controls
38 lines (32 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package cmd
import (
"fmt"
"log"
"github.com/codegangsta/cli"
"github.com/exercism/cli/api"
"github.com/exercism/cli/config"
"github.com/exercism/cli/user"
)
// Tracks lists available tracks.
func Tracks(ctx *cli.Context) {
c, err := config.New(ctx.GlobalString("config"))
if err != nil {
log.Fatal(err)
}
client := api.NewClient(c)
tracks, err := client.Tracks()
if err != nil {
log.Fatal(err)
}
curr := user.NewCurriculum(tracks)
fmt.Println("\nActive language tracks:")
curr.Report(user.TrackActive)
fmt.Println("\nInactive language tracks:")
curr.Report(user.TrackInactive)
msg := `
Related commands:
exercism fetch (see 'exercism help fetch')
exercism list (see 'exercism help list')
`
fmt.Println(msg)
}