aboutsummaryrefslogtreecommitdiff
path: root/rubric_config.go
diff options
context:
space:
mode:
authorFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-06 21:06:02 -0500
committerFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-06 21:06:02 -0500
commitcc9e3965a365a9b98fd4c454017dfa8e40860fb1 (patch)
tree6588c40c71d39a5bcc4233afb1416f92e953558b /rubric_config.go
parent82dcbb2a65a6a073a1809fcd202b540885df02d2 (diff)
downloadplanr-cc9e3965a365a9b98fd4c454017dfa8e40860fb1.tar.xz
planr-cc9e3965a365a9b98fd4c454017dfa8e40860fb1.zip
Add --extra flag to print addtional configuration info
Diffstat (limited to 'rubric_config.go')
-rw-r--r--rubric_config.go15
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]