Skip to content
This repository has been archived by the owner on Dec 14, 2024. It is now read-only.

Commit

Permalink
Fix parse bugs. Close #11, #12
Browse files Browse the repository at this point in the history
  • Loading branch information
xalanq committed May 29, 2019
1 parent 1d2bc16 commit b507a8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cf.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
docopt "github.com/docopt/docopt-go"
)

const version = "v0.5.2"
const version = "v0.5.3"

func main() {
usage := `Codeforces Tool $%version%$ (cf). https://github.com/xalanq/cf-tool
Expand Down
6 changes: 3 additions & 3 deletions client/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (c *Client) ParseContestProblem(contestID, problemID, path string) (samples
func (c *Client) ParseContest(contestID, rootPath string) (err error) {
problems, err := c.StatisContest(contestID)
if err != nil {
return err
return
}
wg := sync.WaitGroup{}
wg.Add(len(problems))
Expand All @@ -108,13 +108,13 @@ func (c *Client) ParseContest(contestID, rootPath string) (err error) {
samples, err := c.ParseContestProblem(contestID, problem.ID, path)
mu.Lock()
if err != nil {
color.Red("Failed %v %v", contestID, problem.ID)
color.Red("Failed %v %v. Error: %v", contestID, problem.ID, err.Error())
} else {
color.Green("Parsed %v %v with %v samples", contestID, problemID, samples)
}
mu.Unlock()
}()
}
wg.Wait()
return nil
return
}
4 changes: 2 additions & 2 deletions cmd/parse.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd

import (
"fmt"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -45,7 +44,8 @@ func Parse(args map[string]interface{}) error {
}
samples, err := cln.ParseContestProblem(contestID, problemID, path)
if err != nil {
return fmt.Errorf("Failed %v %v", contestID, problemID)
color.Red("Failed %v %v", contestID, problemID)
return err
}
color.Green("Parsed %v %v with %v samples", contestID, problemID, samples)
return nil
Expand Down

0 comments on commit b507a8e

Please sign in to comment.