Skip to content

Commit

Permalink
Add GetFlag method to Scope
Browse files Browse the repository at this point in the history
  • Loading branch information
plorenz committed Sep 6, 2023
1 parent 9f3f455 commit 783c9c8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/model/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ func (scope *Scope) GetBoolVariable(name string) (bool, bool) {
return strings.EqualFold("true", fmt.Sprintf("%v", val)), true
}

func (scope *Scope) GetFlag(name string) bool {
result, _ := scope.GetBoolVariable(name)
return result
}

func (scope *Scope) GetVariableOr(name string, defaultValue interface{}) interface{} {
val, found := scope.GetVariable(name)
if found {
Expand Down

0 comments on commit 783c9c8

Please sign in to comment.