cmd

package
v0.0.0-...-c53040f Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const ContestRegStr = `\d+`

ContestRegStr contest

View Source
const GroupRegStr = `\w{10}`

GroupRegStr group

View Source
const ProblemRegStr = `\w+`

ProblemRegStr problem

View Source
const StrictProblemRegStr = `[a-zA-Z]+\d*`

StrictProblemRegStr strict problem

View Source
const SubmissionRegStr = `\d+`

SubmissionRegStr submission

Variables

View Source
var ArgRegStr = [...]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))?`, ContestRegStr, ProblemRegStr),
	fmt.Sprintf(`/gym/(?P<contestID>%v)(/problem/(?P<problemID>%v))?`, ContestRegStr, ProblemRegStr),
	fmt.Sprintf(`/problemset/problem/(?P<contestID>%v)/(?P<problemID>%v)`, ContestRegStr, ProblemRegStr),
	fmt.Sprintf(`/group/(?P<groupID>%v)(/contest/(?P<contestID>%v)(/problem/(?P<problemID>%v))?)?`, GroupRegStr, ContestRegStr, ProblemRegStr),
	fmt.Sprintf(`/problemsets/acmsguru/problem/(?P<contestID>%v)/(?P<problemID>%v)`, ContestRegStr, ProblemRegStr),
	fmt.Sprintf(`/problemsets/acmsguru/submission/(?P<contestID>%v)/(?P<submissionID>%v)`, ContestRegStr, SubmissionRegStr),
	fmt.Sprintf(`/submission/(?P<submissionID>%v)`, SubmissionRegStr),
	fmt.Sprintf(`^(?P<contestID>%v)(?P<problemID>%v)$`, ContestRegStr, StrictProblemRegStr),
	fmt.Sprintf(`^(?P<contestID>%v)$`, ContestRegStr),
	fmt.Sprintf(`^(?P<problemID>%v)$`, StrictProblemRegStr),
	fmt.Sprintf(`^(?P<groupID>%v)$`, GroupRegStr),
}

ArgRegStr for parsing arg

View Source
var ArgType = [...]string{
	"contest",
	"gym",
	"group",
	"acmsguru",
	"contest",
	"gym",
	"contest",
	"group",
	"acmsguru",
	"acmsguru",
	"",
	"",
	"",
	"",
	"",
}

ArgType type

View Source
var ArgTypePathRegStr = [...]string{
	fmt.Sprintf("%v/%v/((?P<contestID>%v)/((?P<problemID>%v)/)?)?", "%v", "%v", ContestRegStr, ProblemRegStr),
	fmt.Sprintf("%v/%v/((?P<contestID>%v)/((?P<problemID>%v)/)?)?", "%v", "%v", ContestRegStr, ProblemRegStr),
	fmt.Sprintf("%v/%v/((?P<groupID>%v)/((?P<contestID>%v)/((?P<problemID>%v)/)?)?)?", "%v", "%v", GroupRegStr, ContestRegStr, ProblemRegStr),
	fmt.Sprintf("%v/%v/((?P<problemID>%v)/)?", "%v", "%v", ProblemRegStr),
}

ArgTypePathRegStr path

Functions

func Clone

func Clone(args ParsedArgs) (err error)

Clone command

func Eval

func Eval(opts docopt.Opts) error

Eval opts

func Gen

func Gen(args ParsedArgs) (err error)

Gen command

func List

func List(args ParsedArgs) (err error)

List command

func Open

func Open(args ParsedArgs) (err error)

Open command

func Parse

func Parse(args ParsedArgs) (err error)

Parse command

func Pull

func Pull(args ParsedArgs) (err error)

Pull command

func Race

func Race(args ParsedArgs) (err error)

Race command

func Setup

func Setup(parsedArgs ParsedArgs) error

Setup command

func Sid

func Sid(args ParsedArgs) (err error)

Sid command

func Stand

func Stand(args ParsedArgs) (err error)

Stand command

func Submit

func Submit(args ParsedArgs) (err error)

Submit command

func Test

func Test(args ParsedArgs) (err error)

Test command

func Upgrade

func Upgrade(args ParsedArgs) (err error)

Upgrade itself

func Watch

func Watch(args ParsedArgs) (err error)

Watch command

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 {
	Info      client.Info
	File      string   `docopt:"--file"`
	Handle    string   `docopt:"--handle"`
	Password  string   `docopt:"--pass"`
	LangId    string   `docopt:"--lang"`
	Specifier []string `docopt:"<specifier>"`
	Alias     string   `docopt:"<alias>"`
	Accepted  bool     `docopt:"ac"`
	All       bool     `docopt:"all"`
	Version   string   `docopt:"{version}"`
	Setup     bool     `docopt:"setup"`
	Submit    bool     `docopt:"submit"`
	Upgrade   bool     `docopt:"upgrade"`
}

ParsedArgs parsed arguments

type WriteCounter

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

WriteCounter progress counter

func (*WriteCounter) Print

func (w *WriteCounter) Print()

Print print progress

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