libfic: Refactor flag label parsing
This commit is contained in:
parent
2b26b2b819
commit
721908ee18
2 changed files with 14 additions and 8 deletions
|
@ -261,14 +261,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
|||
}
|
||||
|
||||
// Treat array flags
|
||||
if k.Label[0] == '`' && len(k.Label) > 4 {
|
||||
flag.Label = k.Label[4:]
|
||||
flag.Separator = string(k.Label[1])
|
||||
flag.IgnoreOrder = k.Label[2] == 't'
|
||||
flag.NbLines, _ = strconv.ParseUint(string(k.Label[3]), 10, 8)
|
||||
} else {
|
||||
flag.Label = k.Label
|
||||
}
|
||||
flag.Label, flag.Separator, flag.IgnoreOrder, flag.NbLines = k.AnalyzeFlagLabel()
|
||||
|
||||
// Fill more information if the flag is displaied
|
||||
if flag.Solved == nil {
|
||||
|
|
Reference in a new issue