mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 12:53:59 +03:00
lib/types: enhances separatedString's description
The previous description "string" is misleading in the full options manual pages; they are actually concatenated strings, with a specific character. The empty string version ("types.string") has been special-cased to provide a better message.
This commit is contained in:
parent
0a7e258012
commit
0808c7cd31
@ -194,7 +194,10 @@ rec {
|
|||||||
# separator between the values).
|
# separator between the values).
|
||||||
separatedString = sep: mkOptionType rec {
|
separatedString = sep: mkOptionType rec {
|
||||||
name = "separatedString";
|
name = "separatedString";
|
||||||
description = "string";
|
description = if sep == ""
|
||||||
|
then "Concatenated string" # for types.string.
|
||||||
|
else "strings concatenated with ${builtins.toJSON sep}"
|
||||||
|
;
|
||||||
check = isString;
|
check = isString;
|
||||||
merge = loc: defs: concatStringsSep sep (getValues defs);
|
merge = loc: defs: concatStringsSep sep (getValues defs);
|
||||||
functor = (defaultFunctor name) // {
|
functor = (defaultFunctor name) // {
|
||||||
|
Loading…
Reference in New Issue
Block a user