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

More configurable path #70

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Bug fix for problem type detection
  • Loading branch information
user202729 committed Mar 4, 2020
commit 7a41feffd3addb2caa61f5f004370958f23a2ff3
15 changes: 9 additions & 6 deletions cmd/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,8 @@ func parseArgs(opts docopt.Opts) error {
info.SubmissionID = value
}
}
if info.ProblemType == "" || info.ProblemType == "contest" || info.ProblemType == "gym" {
if len(info.ContestID) < 6 {
info.ProblemType = "contest"
} else {
info.ProblemType = "gym"
}
if info.ContestID != "" && len(info.ContestID) < 6 {
info.ProblemType = "contest"
}
if info.ProblemType == "" {
parsed := parsePath(path)
Expand All @@ -113,6 +109,13 @@ func parseArgs(opts docopt.Opts) error {
info.ProblemID = value
}
}
if info.ProblemType == "" || info.ProblemType == "contest" || info.ProblemType == "gym" {
if len(info.ContestID) < 6 {
info.ProblemType = "contest"
} else {
info.ProblemType = "gym"
}
}
if info.ProblemType == "acmsguru" {
if info.ContestID != "99999" && info.ContestID != "" {
info.ProblemID = info.ContestID
Expand Down