diff --git a/main.go b/main.go index 70cc8e415..3013c0224 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,29 @@ func main() { app.Usage = "A command line tool to interact with http://exercism.io" app.Version = VERSION app.Commands = []cli.Command{ + { + Name: "current", + ShortName: "c", + Usage: "Show the current assignments", + Action: func(c *cli.Context) { + config, err := ConfigFromFile(HomeDir()) + if err != nil { + fmt.Println("Are you sure you are logged in? Please login again.") + return + } + currentAssignments, err := FetchAssignments(config, FetchEndpoints["current"]) + if err != nil { + fmt.Println(err) + return + } + + fmt.Println("Current Assignments") + + for _, a := range currentAssignments { + fmt.Printf("%v: %v\n", strings.Title(a.Track), a.Slug) + } + }, + }, { Name: "demo", ShortName: "d",