-
-
Notifications
You must be signed in to change notification settings - Fork 369
Expand file tree
/
Copy pathtracks.go
More file actions
37 lines (31 loc) · 769 Bytes
/
tracks.go
File metadata and controls
37 lines (31 loc) · 769 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
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.Read(ctx.GlobalString("config"))
if err != nil {
log.Fatal(err)
}
tracks, err := api.Tracks(fmt.Sprintf("%s/tracks", c.XAPI))
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)
// TODO: implement `list` command to list problems in a track
msg := `
Related commands:
exercism fetch (see 'exercism help fetch')
`
fmt.Println(msg)
}