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

Commit b507a8e

Browse files
committedMay 29, 2019
Fix parse bugs. Close #11, #12
1 parent 1d2bc16 commit b507a8e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed
 

‎cf.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
docopt "github.com/docopt/docopt-go"
1313
)
1414

15-
const version = "v0.5.2"
15+
const version = "v0.5.3"
1616

1717
func main() {
1818
usage := `Codeforces Tool $%version%$ (cf). https://github.com/xalanq/cf-tool

‎client/parse.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (c *Client) ParseContestProblem(contestID, problemID, path string) (samples
9191
func (c *Client) ParseContest(contestID, rootPath string) (err error) {
9292
problems, err := c.StatisContest(contestID)
9393
if err != nil {
94-
return err
94+
return
9595
}
9696
wg := sync.WaitGroup{}
9797
wg.Add(len(problems))
@@ -108,13 +108,13 @@ func (c *Client) ParseContest(contestID, rootPath string) (err error) {
108108
samples, err := c.ParseContestProblem(contestID, problem.ID, path)
109109
mu.Lock()
110110
if err != nil {
111-
color.Red("Failed %v %v", contestID, problem.ID)
111+
color.Red("Failed %v %v. Error: %v", contestID, problem.ID, err.Error())
112112
} else {
113113
color.Green("Parsed %v %v with %v samples", contestID, problemID, samples)
114114
}
115115
mu.Unlock()
116116
}()
117117
}
118118
wg.Wait()
119-
return nil
119+
return
120120
}

‎cmd/parse.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cmd
22

33
import (
4-
"fmt"
54
"os"
65
"path/filepath"
76
"strings"
@@ -45,7 +44,8 @@ func Parse(args map[string]interface{}) error {
4544
}
4645
samples, err := cln.ParseContestProblem(contestID, problemID, path)
4746
if err != nil {
48-
return fmt.Errorf("Failed %v %v", contestID, problemID)
47+
color.Red("Failed %v %v", contestID, problemID)
48+
return err
4949
}
5050
color.Green("Parsed %v %v with %v samples", contestID, problemID, samples)
5151
return nil

0 commit comments

Comments
 (0)
This repository has been archived.