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:
parent
9581664fb9
commit
daa6f9c7ef
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue