cmd

package
v0.11.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const CodeforcesContestRegStr = `\d+`
View Source
const CodeforcesGroupRegStr = `\w{10}`
View Source
const CodeforcesProblemRegStr = `\w+`
View Source
const CodeforcesStrictProblemRegStr = `[a-zA-Z]+\d*`
View Source
const CodeforcesSubmissionRegStr = `\d+`
View Source
const ErrorFileIsNotADirectory = "this file is not a directory"
View Source
const ErrorMultipleProblemsFound = "more than one problem found matching criteria"
View Source
const ErrorNoProblemFound = "no problem found matching criteria"
View Source
const ErrorPackageCouldntBeDetermined = "package path couldn't be determined"
View Source
const ErrorPackageNotFound = "no package found"
View Source
const ErrorProblemIDNotFound = "problem id not found"
View Source
const ErrorTestsNotFound = "no tests found"
View Source
const OIContestRegStr = `[MCLXVI]+`
View Source
const OIStageRegStr = `[1-3]`
View Source
const SioContestRegStr = `[\w-]+?`
View Source
const SioProblemIdRegStr = `\d+`
View Source
const SioProblemRegStr = `[a-z]+\d*`
View Source
const SioRoundRegStr = `\w+?`
View Source
const StrictSzkopulProblemRegStr = `[a-z]{3}\d*`
View Source
const SzkopulProblemSecretKeyRegStr = `[A-Za-z0-9-_]{24}`

Variables

View Source
var CodeforcesArgRegStr = [...]string{
	`^[cC][oO][nN][tT][eE][sS][tT][sS]?$`,
	`^[gG][yY][mM][sS]?$`,
	`^[gG][rR][oO][uU][pP][sS]?$`,
	`^[aA][cC][mM][sS][gG][uU][rR][uU]$`,
	fmt.Sprintf(`/contest/(?P<contestID>%v)(/problem/(?P<problemID>%v))?`, CodeforcesContestRegStr, CodeforcesProblemRegStr),
	fmt.Sprintf(`/gym/(?P<contestID>%v)(/problem/(?P<problemID>%v))?`, CodeforcesContestRegStr, CodeforcesProblemRegStr),
	fmt.Sprintf(`/problemset/problem/(?P<contestID>%v)/(?P<problemID>%v)`, CodeforcesContestRegStr, CodeforcesProblemRegStr),
	fmt.Sprintf(`/group/(?P<groupID>%v)(/contest/(?P<contestID>%v)(/problem/(?P<problemID>%v))?)?`, CodeforcesGroupRegStr, CodeforcesContestRegStr, CodeforcesProblemRegStr),
	fmt.Sprintf(`/problemsets/acmsguru/problem/(?P<contestID>%v)/(?P<problemID>%v)`, CodeforcesContestRegStr, CodeforcesProblemRegStr),
	fmt.Sprintf(`/problemsets/acmsguru/submission/(?P<contestID>%v)/(?P<submissionID>%v)`, CodeforcesContestRegStr, CodeforcesSubmissionRegStr),
	fmt.Sprintf(`/submission/(?P<submissionID>%v)`, CodeforcesSubmissionRegStr),
	fmt.Sprintf(`^(?P<contestID>%v)(?P<problemID>%v)$`, CodeforcesContestRegStr, CodeforcesStrictProblemRegStr),
	fmt.Sprintf(`^(?P<contestID>%v)$`, CodeforcesContestRegStr),
	fmt.Sprintf(`^(?P<problemID>%v)$`, CodeforcesStrictProblemRegStr),
	fmt.Sprintf(`^(?P<groupID>%v)$`, CodeforcesGroupRegStr),
}
View Source
var CodeforcesArgType = [...]string{
	"contest",
	"gym",
	"group",
	"acmsguru",
	"contest",
	"gym",
	"contest",
	"group",
	"acmsguru",
	"acmsguru",
	"",
	"",
	"",
	"",
	"",
}
View Source
var CodeforcesArgTypePathRegStr = [...]string{
	fmt.Sprintf("%v/%v/((?P<contestID>%v)/((?P<problemID>%v)/)?)?", "%v", "%v", CodeforcesContestRegStr, CodeforcesProblemRegStr),
	fmt.Sprintf("%v/%v/((?P<contestID>%v)/((?P<problemID>%v)/)?)?", "%v", "%v", CodeforcesContestRegStr, CodeforcesProblemRegStr),
	fmt.Sprintf("%v/%v/((?P<groupID>%v)/((?P<contestID>%v)/((?P<problemID>%v)/)?)?)?", "%v", "%v", CodeforcesGroupRegStr, CodeforcesContestRegStr, CodeforcesProblemRegStr),
	fmt.Sprintf("%v/%v/((?P<problemID>%v)/)?", "%v", "%v", CodeforcesProblemRegStr),
}
View Source
var SioArgRegStr = [...]string{
	fmt.Sprintf(`/c/(?P<contestID>%v)/(p/(?P<problemAlias>%v)?)?`, SioContestRegStr, SioProblemRegStr),
	fmt.Sprintf(`^(?P<problemID>%v)$`, SioProblemIdRegStr),
	fmt.Sprintf(`^(?P<problemAlias>%v)$`, SioProblemRegStr),
	fmt.Sprintf(`^(?P<contestID>%v)$`, SioContestRegStr),
}
View Source
var SioPathRegStr = fmt.Sprintf("%v/((?P<contestID>%v)/((?P<round>%v)/((?P<problemAlias>%v)/)?)?)?", "%v", SioContestRegStr, SioRoundRegStr, SioProblemRegStr)
View Source
var SzkopulArgRegStr = [...]string{
	`^[oO][iI]?$`,
	SzkopulLinkRegStr,
	fmt.Sprintf(`^(?P<problemSecretKey>%v)$`, SzkopulProblemSecretKeyRegStr),
	fmt.Sprintf(`^(?P<problemAlias>%v)$`, StrictSzkopulProblemRegStr),
	fmt.Sprintf(`^(?P<contestID>%v)$`, OIContestRegStr),
	fmt.Sprintf(`^(?P<stageID>%v)$`, OIStageRegStr),
}
View Source
var SzkopulArgType = [...]string{
	"OI",
	"OI",
	"OI",
	"OI",
	"OI",
	"OI",
}
View Source
var SzkopulLinkRegStr = fmt.Sprintf(`/problemset/problem/(?P<problemSecretKey>%v)(/site(/\?key=\w+)?)?`, SzkopulProblemSecretKeyRegStr)
View Source
var SzkopulPathRegStr = [...]string{
	fmt.Sprintf("%v/%v/((?P<contestID>%v)/((?P<stageID>%v)/((?P<problemAlias>%v)/)?)?)?", "%v", "%v", OIContestRegStr, OIStageRegStr, StrictSzkopulProblemRegStr),
}

Functions

func AddPackage added in v0.8.0

func AddPackage() (err error)

func ArgsPackagePath added in v0.8.0

func ArgsPackagePath() (path string, err error)

func CodeforcesList

func CodeforcesList() (err error)

func CodeforcesOpen

func CodeforcesOpen() (err error)

func CodeforcesParse

func CodeforcesParse() (err error)

func CodeforcesPull

func CodeforcesPull() (err error)

func CodeforcesRace

func CodeforcesRace() (err error)

func CodeforcesSid

func CodeforcesSid() (err error)

func CodeforcesStand

func CodeforcesStand() (err error)

func CodeforcesSubmit

func CodeforcesSubmit() (err error)

func CodeforcesWatch

func CodeforcesWatch() (err error)

func Config

func Config() (err error)

func DatabaseAdd

func DatabaseAdd() (err error)

func DatabaseFind

func DatabaseFind() (err error)

func DatabaseGoto

func DatabaseGoto() (err error)

func Eval

func Eval(opts docopt.Opts) error

func ExtendTaskInfo

func ExtendTaskInfo(task database_client.Task, props valuesProperties) database_client.Task

func Gen

func Gen() (err error)

func GenFiles

func GenFiles(source, currentPath, ext string) error

func GetTaskFromArgs

func GetTaskFromArgs() database_client.Task

func PackageTest added in v0.8.0

func PackageTest() (err error)

func ReadTask

func SioList added in v0.5.2

func SioList() (err error)

func SioListContests added in v0.7.0

func SioListContests() (err error)

func SioOpen added in v0.5.2

func SioOpen() (err error)

func SioParse added in v0.5.2

func SioParse() (err error)

func SioRace added in v0.5.2

func SioRace() (err error)

func SioSid added in v0.5.2

func SioSid() (err error)

func SioStand added in v0.5.2

func SioStand() (err error)

func SioSubmit added in v0.5.2

func SioSubmit() (err error)

func SioWatch added in v0.5.2

func SioWatch() (err error)

func StressTest

func StressTest() (err error)

func SubPath

func SubPath(parent, sub string) bool

func SzkopulList added in v0.4.1

func SzkopulList() (err error)

func SzkopulOpen

func SzkopulOpen() (err error)

func SzkopulParse added in v0.4.0

func SzkopulParse() (err error)

func SzkopulSid

func SzkopulSid() (err error)

func SzkopulSubmit

func SzkopulSubmit() (err error)

func SzkopulWatch

func SzkopulWatch() (err error)

func Test

func Test() (err error)

func Upgrade

func Upgrade() (err error)

Types

type CodeList

type CodeList struct {
	Name  string
	Index []int
}

CodeList Name matches some template suffix, index are template array indexes

type ParsedArgs

type ParsedArgs struct {
	CodeforcesInfo codeforces_client.Info
	SzkopulInfo    szkopul_client.Info
	SioInfo        sio_client.Info
	File           string
	Generator      string
	Solve          string
	Brute          string
	Source         string
	Name           string
	Path           string
	Link           string
	Shortname      string
	Contest        string
	Stage          string
	TimeLimit      string   `docopt:"--time_limit"`
	MemoryLimit    string   `docopt:"--memory_limit"`
	Specifier      []string `docopt:"<specifier>"`
	Alias          string   `docopt:"<alias>"`
	Accepted       bool     `docopt:"ac"`
	All            bool     `docopt:"all"`
	Handle         string   `docopt:"<handle>"`
	Version        string   `docopt:"{version}"`
	Config         bool     `docopt:"config"`
	Submit         bool     `docopt:"submit"`
	List           bool     `docopt:"list"`
	Parse          bool     `docopt:"parse"`
	Gen            bool     `docopt:"gen"`
	Test           bool     `docopt:"test"`
	PackageTest    bool     `docopt:"package_test"`
	AddPackage     bool     `docopt:"add_package"`
	Watch          bool     `docopt:"watch"`
	Open           bool     `docopt:"open"`
	Stand          bool     `docopt:"stand"`
	Sid            bool     `docopt:"sid"`
	Race           bool     `docopt:"race"`
	Pull           bool     `docopt:"pull"`
	Clone          bool     `docopt:"clone"`
	Upgrade        bool     `docopt:"upgrade"`
	StressTest     bool     `docopt:"stress-test"`
	Database       bool     `docopt:"db"`
	Add            bool     `docopt:"add"`
	Find           bool     `docopt:"find"`
	Goto           bool     `docopt:"goto"`
	Codeforces     bool
	Szkopul        bool
	SioStaszic     bool
	SioMimuw       bool
	Oiejq          bool
	Verbose        bool
}
var Args *ParsedArgs

type WriteCounter

type WriteCounter struct {
	Count, Total uint
	// contains filtered or unexported fields
}

func (*WriteCounter) Print

func (w *WriteCounter) Print()

func (*WriteCounter) Write

func (w *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL