cmd

package
v0.0.0-...-0b9d03a Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 28 Imported by: 1

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() (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

func Open() (err error)

Open command

func Parse

func Parse() (err error)

Parse command

func Pull

func Pull() (err error)

Pull command

func Race

func Race() (err error)

Race command

func Sid

func Sid() (err error)

Sid command

func Stand

func Stand() (err error)

Stand command

func Submit

func Submit() (err error)

Submit command

func Test

func Test() (err error)

Test command

func Upgrade

func Upgrade() (err error)

Upgrade itself

func Watch

func Watch() (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
	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

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