Implement flag arrays
This commit is contained in:
parent
3056a19d09
commit
dbf1985d25
6 changed files with 90 additions and 8 deletions
|
|
@ -39,6 +39,7 @@ type myTeamMCQ struct {
|
|||
type myTeamFlag struct {
|
||||
Label string `json:"label"`
|
||||
Help string `json:"help,omitempty"`
|
||||
Separator string `json:"separator,omitempty"`
|
||||
Solved *time.Time `json:"found,omitempty"`
|
||||
Soluce string `json:"soluce,omitempty"`
|
||||
Choices map[string]string `json:"choices,omitempty"`
|
||||
|
|
@ -194,7 +195,12 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
|||
flag.Solved = t.HasPartiallySolved(k)
|
||||
}
|
||||
|
||||
flag.Label = k.Label
|
||||
if k.Label[0] == '`' && len(k.Label) > 2 {
|
||||
flag.Label = k.Label[2:]
|
||||
flag.Separator = string(k.Label[1])
|
||||
} else {
|
||||
flag.Label = k.Label
|
||||
}
|
||||
|
||||
if flag.Solved == nil {
|
||||
flag.Help = k.Help
|
||||
|
|
|
|||
Reference in a new issue