diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2021-09-06 21:06:02 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2021-09-06 21:06:02 -0500 |
| commit | e4c3de10306fd7eee993f8b5e954337575709e89 (patch) | |
| tree | ba2277b505db5f1aacd011d4dd4614370ac38110 /rubric_config.go | |
| parent | c0288be34b6db18accf7e585c679764cf36f80c3 (diff) | |
Add --extra flag to print addtional configuration info
Diffstat (limited to 'rubric_config.go')
| -rw-r--r-- | rubric_config.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/rubric_config.go b/rubric_config.go index d533a7b..00cd76c 100644 --- a/rubric_config.go +++ b/rubric_config.go @@ -39,8 +39,9 @@ type InheritableConfig interface { // Program-wide configuration which is recognized // in defaults.toml type Defaults struct { + Description string Points *float32 - Adapter *string + Adapter string /* The TOML library only parses exported fields. @@ -73,18 +74,22 @@ func (child *Defaults) Inherit(p interface{}) { // Inherit properties which haven't been configured if child.Points == nil { - child.Points = parent.Points; + child.Points = parent.Points } - if child.Adapter == nil { - child.Adapter = parent.Adapter; + if child.Adapter == "" { + child.Adapter = parent.Adapter } + if child.Description == "" { + child.Description = parent.Description + } + // Call the inherit method as defined by the adapters // If an adapter is undefined, inherit the parent configuration // // _configs represents all adapters (registered to a runner) - for _, adapter := range *child.configs_ { + for _, adapter := range *parent.configs_ { parent_adapter, parent_exists := parent.adapters_[adapter.Name] child_adapter, child_exists := child.adapters_[adapter.Name] |
