mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
Merge pull request #230353 from ncfavier/defaultText-only
lib/options: fix rendering of options with only a defaultText
This commit is contained in:
commit
6674b8a6f1
@ -261,7 +261,7 @@ rec {
|
|||||||
concatMap (opt:
|
concatMap (opt:
|
||||||
let
|
let
|
||||||
name = showOption opt.loc;
|
name = showOption opt.loc;
|
||||||
docOption = rec {
|
docOption = {
|
||||||
loc = opt.loc;
|
loc = opt.loc;
|
||||||
inherit name;
|
inherit name;
|
||||||
description = opt.description or null;
|
description = opt.description or null;
|
||||||
@ -280,9 +280,9 @@ rec {
|
|||||||
renderOptionValue opt.example
|
renderOptionValue opt.example
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
// optionalAttrs (opt ? default) {
|
// optionalAttrs (opt ? defaultText || opt ? default) {
|
||||||
default =
|
default =
|
||||||
builtins.addErrorContext "while evaluating the default value of option `${name}`" (
|
builtins.addErrorContext "while evaluating the ${if opt?defaultText then "defaultText" else "default value"} of option `${name}`" (
|
||||||
renderOptionValue (opt.defaultText or opt.default)
|
renderOptionValue (opt.defaultText or opt.default)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user