aboutsummaryrefslogtreecommitdiff
path: root/bpkg/types-parsers.txx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-08-14 14:36:44 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-08-16 14:53:54 +0300
commited437dbd3483baa3d15d1d86d8f057d9112653b1 (patch)
treecbf3974e8b1774ccccd818442cf042e501190b09 /bpkg/types-parsers.txx
parent80ee886ca0bd3e41434621a056125c92f31b1aea (diff)
Add support for default options files
Diffstat (limited to 'bpkg/types-parsers.txx')
-rw-r--r--bpkg/types-parsers.txx15
1 files changed, 15 insertions, 0 deletions
diff --git a/bpkg/types-parsers.txx b/bpkg/types-parsers.txx
index df6796f..f187fc7 100644
--- a/bpkg/types-parsers.txx
+++ b/bpkg/types-parsers.txx
@@ -65,5 +65,20 @@ namespace bpkg
}
}
}
+
+ template <const char* const* Q, typename V>
+ void parser<qualified_option<Q, V>>::
+ merge (qualified_option<Q, V>& b, const qualified_option<Q, V>& a)
+ {
+ for (const auto& o: a)
+ {
+ auto i (b.find (o.first));
+
+ if (i != b.end ())
+ i->second = o.second;
+ else
+ b.emplace (o.first, o.second);
+ }
+ }
}
}