From cc9e3965a365a9b98fd4c454017dfa8e40860fb1 Mon Sep 17 00:00:00 2001 From: Flu0r1ne Date: Mon, 6 Sep 2021 21:06:02 -0500 Subject: Add --extra flag to print addtional configuration info --- rubric_config.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'rubric_config.go') 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] -- cgit v1.2.3