cmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: MIT Imports: 28 Imported by: 44

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 added in v0.7.0

func Clone() (err error)

Clone command

func Config

func Config() (err error)

Config command

func Eval

func Eval(opts docopt.Opts) error

Eval opts

func Gen

func Gen() (err error)

Gen command

func List

func List() (err error)

List command

func Open added in v0.2.1

func Open() (err error)

Open command

func Parse

func Parse() (err error)

Parse command

func Pull added in v0.4.0

func Pull() (err error)

Pull command

func Race added in v0.3.0

func Race() (err error)

Race command

func Sid added in v0.5.5

func Sid() (err error)

Sid command

func Stand added in v0.3.2

func Stand() (err error)

Stand command

func Submit

func Submit() (err error)

Submit command

func Test

func Test() (err error)

Test command

func Upgrade added in v0.5.0

func Upgrade() (err error)

Upgrade itself

func Watch added in v0.2.0

func Watch() (err error)

Watch command

Types

type CodeList added in v0.1.2

type CodeList struct {
	Name  string
	Index []int
}

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

type ParsedArgs added in v1.0.0

type ParsedArgs struct {
	Info      client.Info
	File      string
	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"`
	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"`
}

ParsedArgs parsed arguments

var Args *ParsedArgs

Args global variable

type WriteCounter added in v0.5.0

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

WriteCounter progress counter

func (*WriteCounter) Print added in v0.5.0

func (w *WriteCounter) Print()

Print print progress

func (*WriteCounter) Write added in v0.5.0

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