diff options
author | Patrick Jackson <patrick@jackson.dev> | 2022-10-20 12:05:04 -0700 |
---|---|---|
committer | Patrick Jackson <patrick@jackson.dev> | 2022-10-20 12:05:04 -0700 |
commit | b44df1370187bea82814a2da50a6ded54fca65f2 (patch) | |
tree | c884f4b52358d0f8b95c2ee0c5d4aa321e0ec2bc /doc | |
parent | 11b5cf95615ffb2a2475ac444f4fe103e471748f (diff) |
manual: update options generation code to use default values
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual/generate-options.nix | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/manual/generate-options.nix b/doc/manual/generate-options.nix index 2d586fa1b..680b709c8 100644 --- a/doc/manual/generate-options.nix +++ b/doc/manual/generate-options.nix @@ -11,16 +11,16 @@ concatStrings (map + concatStrings (map (s: " ${s}\n") (splitLines option.description)) + "\n\n" + (if option.documentDefault then " **Default:** " + ( - if option.value == "" || option.value == [] + if option.defaultValue == "" || option.defaultValue == [] then "*empty*" - else if isBool option.value - then (if option.value then "`true`" else "`false`") + else if isBool option.defaultValue + then (if option.defaultValue then "`true`" else "`false`") else # n.b. a StringMap value type is specified as a string, but # this shows the value type. The empty stringmap is "null" in # JSON, but that converts to "{ }" here. - (if isAttrs option.value then "`\"\"`" - else "`" + toString option.value + "`")) + "\n\n" + (if isAttrs option.defaultValue then "`\"\"`" + else "`" + toString option.defaultValue + "`")) + "\n\n" else " **Default:** *machine-specific*\n") + (if option.aliases != [] then " **Deprecated alias:** " + (concatStringsSep ", " (map (s: "`${s}`") option.aliases)) + "\n\n" |