Add a common merge function. (mergeOneOption)

This merge function allow only one definition for an option.

svn path=/nixpkgs/trunk/; revision=13841
This commit is contained in:
Nicolas Pierron 2009-01-25 00:31:38 +00:00
parent 9581664fb9
commit daa6f9c7ef

View file

@ -500,6 +500,11 @@ rec {
(x: if builtins ? isString then builtins.isString x else x + "")
concatStrings;
mergeOneOption = name: list:
if list == [] then abort "This case should never happens."
else if tail list != [] then throw "Multiple definitions. Only one is allowed for this option."
else head list;
# Handle the traversal of option sets. All sets inside 'opts' are zipped
# and options declaration and definition are separated. If no option are