Skip to content

Commit

Permalink
lib/types: enhances separatedString's description
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
samueldr committed Oct 12, 2018
1 parent 0a7e258 commit 0808c7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/types.nix
Expand Up @@ -194,7 +194,10 @@ rec {
# separator between the values).
separatedString = sep: mkOptionType rec {
name = "separatedString";
description = "string";
description = if sep == ""
then "Concatenated string" # for types.string.
else "strings concatenated with ${builtins.toJSON sep}"
;
check = isString;
merge = loc: defs: concatStringsSep sep (getValues defs);
functor = (defaultFunctor name) // {
Expand Down

0 comments on commit 0808c7c

Please sign in to comment.