diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2023-03-23 10:08:49 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2023-03-23 10:08:49 +0100 |
commit | 2851e239a7a4c7de34a2a2b13d3076b10d34ebd7 (patch) | |
tree | d3e460b2a8652830526bd4936d1d9dd25a77c7a4 | |
parent | 80f0b8d3070f346bb89bd0ab1a541940a7ceeec1 (diff) |
Make useAnchors a named argument
-rw-r--r-- | doc/manual/generate-manpage.nix | 2 | ||||
-rw-r--r-- | doc/manual/local.mk | 2 | ||||
-rw-r--r-- | doc/manual/utils.nix | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/doc/manual/generate-manpage.nix b/doc/manual/generate-manpage.nix index 02d289eb1..86f2ca567 100644 --- a/doc/manual/generate-manpage.nix +++ b/doc/manual/generate-manpage.nix @@ -137,7 +137,7 @@ let **Settings**: - ${showSettings false settings} + ${showSettings { useAnchors = false; } settings} ''; in concatStrings (attrValues (mapAttrs showStore cliDump.stores)); diff --git a/doc/manual/local.mk b/doc/manual/local.mk index 8bf89b408..82c9a87a7 100644 --- a/doc/manual/local.mk +++ b/doc/manual/local.mk @@ -66,7 +66,7 @@ $(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/generate-manpage.nix $(bindir)/ $(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/utils.nix $(d)/src/command-ref/conf-file-prefix.md $(bindir)/nix @cat doc/manual/src/command-ref/conf-file-prefix.md > $@.tmp - $(trace-gen) $(nix-eval) --expr '(import doc/manual/utils.nix).showSettings true (builtins.fromJSON (builtins.readFile $<))' >> $@.tmp; + $(trace-gen) $(nix-eval) --expr '(import doc/manual/utils.nix).showSettings { useAnchors = true; } (builtins.fromJSON (builtins.readFile $<))' >> $@.tmp; @mv $@.tmp $@ $(d)/nix.json: $(bindir)/nix diff --git a/doc/manual/utils.nix b/doc/manual/utils.nix index a0e5cf1d1..c0f2e956c 100644 --- a/doc/manual/utils.nix +++ b/doc/manual/utils.nix @@ -39,7 +39,7 @@ rec { filterAttrs = pred: set: listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set)); - showSetting = useAnchors: name: { description, documentDefault, defaultValue, aliases, ... }: + showSetting = { useAnchors }: name: { description, documentDefault, defaultValue, aliases, ... }: let result = squash '' - ${if useAnchors @@ -79,5 +79,5 @@ rec { in result; - showSettings = useAnchors: settingsInfo: concatStrings (attrValues (mapAttrs (showSetting useAnchors) settingsInfo)); + showSettings = args: settingsInfo: concatStrings (attrValues (mapAttrs (showSetting args) settingsInfo)); } |