Make useAnchors a named argument
This commit is contained in:
parent
80f0b8d307
commit
2851e239a7
3 changed files with 4 additions and 4 deletions
|
@ -137,7 +137,7 @@ let
|
|||
|
||||
**Settings**:
|
||||
|
||||
${showSettings false settings}
|
||||
${showSettings { useAnchors = false; } settings}
|
||||
'';
|
||||
in concatStrings (attrValues (mapAttrs showStore cliDump.stores));
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue