settings: new parameter to don't respect flag dependancies
This commit is contained in:
parent
09b24cd401
commit
7d9ad18f42
5 changed files with 17 additions and 3 deletions
|
@ -9,6 +9,9 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
// DisplayAllFlags doesn't respect the predefined constraint existing between flags.
|
||||
var DisplayAllFlags bool
|
||||
|
||||
type myTeamFile struct {
|
||||
Path string `json:"path"`
|
||||
Name string `json:"name"`
|
||||
|
@ -179,7 +182,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
|||
for _, k := range flags {
|
||||
var flag myTeamFlag
|
||||
|
||||
if t != nil && !t.CanSeeFlag(k) {
|
||||
if !DisplayAllFlags && t != nil && !t.CanSeeFlag(k) {
|
||||
// Dependancy missing, skip the flag for now
|
||||
continue
|
||||
}
|
||||
|
@ -237,7 +240,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
|||
return nil, err
|
||||
} else {
|
||||
for _, mcq := range mcqs {
|
||||
if t != nil && !t.CanSeeFlag(mcq) {
|
||||
if !DisplayAllFlags && t != nil && !t.CanSeeFlag(mcq) {
|
||||
// Dependancy missing, skip the flag for now
|
||||
continue
|
||||
}
|
||||
|
|
Reference in a new issue