clarify rename error messages

This commit is contained in:
Domen Kožar 2014-02-04 16:32:50 +01:00
parent 77451661d4
commit e1b206b4a9

View File

@ -12,18 +12,20 @@ let
visible = true;
};
# warn option was renamed
obsolete = from: to: rename {
inherit from to;
name = "Obsolete name";
use = x: builtins.trace "Obsolete option `${showOption from}' is used instead of `${showOption to}'." x;
define = x: builtins.trace "Obsolete option `${showOption from}' is defined instead of `${showOption to}'." x;
use = x: builtins.trace "Obsolete option `${showOption from}' is used. It was renamed to `${showOption to}'." x;
define = x: builtins.trace "Obsolete option `${showOption from}' is used. It was renamed to `${showOption to}'." x;
};
# abort if deprecated option is used
deprecated = from: to: rename {
inherit from to;
name = "Deprecated name";
use = x: abort "Deprecated option `${showOption from}' is used instead of `${showOption to}'.";
define = x: abort "Deprecated option `${showOption from}' is defined instead of `${showOption to}'.";
use = x: abort "Deprecated option `${showOption from}' is used. It was renamed to `${showOption to}'.";
define = x: abort "Deprecated option `${showOption from}' is used. It was renamed to `${showOption to}'.";
};
showOption = concatStringsSep ".";