From 2851e239a7a4c7de34a2a2b13d3076b10d34ebd7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 23 Mar 2023 10:08:49 +0100 Subject: [PATCH] Make useAnchors a named argument --- doc/manual/generate-manpage.nix | 2 +- doc/manual/local.mk | 2 +- 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)); }