mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 12:53:59 +03:00
lib/options: Add showOptionWithDefLocs
This commit is contained in:
parent
a234fb2a5b
commit
89b4bd8b24
@ -131,7 +131,8 @@ let
|
||||
getValues getFiles
|
||||
optionAttrSetToDocList optionAttrSetToDocList'
|
||||
scrubOptionValue literalExpression literalExample literalDocBook
|
||||
showOption showFiles unknownModule mkOption mkPackageOption
|
||||
showOption showOptionWithDefLocs showFiles
|
||||
unknownModule mkOption mkPackageOption
|
||||
mdDoc literalMD;
|
||||
inherit (self.types) isType setType defaultTypeMerge defaultFunctor
|
||||
isOptionType mkOptionType;
|
||||
|
@ -7,6 +7,7 @@ let
|
||||
collect
|
||||
concatLists
|
||||
concatMap
|
||||
concatMapStringsSep
|
||||
elemAt
|
||||
filter
|
||||
foldl'
|
||||
@ -340,6 +341,11 @@ rec {
|
||||
in "\n- In `${def.file}'${result}"
|
||||
) defs;
|
||||
|
||||
showOptionWithDefLocs = opt: ''
|
||||
${showOption opt.loc}, with values defined in:
|
||||
${concatMapStringsSep "\n" (defFile: " - ${defFile}") opt.files}
|
||||
'';
|
||||
|
||||
unknownModule = "<unknown-file>";
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user