Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down