mirror of
https://github.com/NixOS/nix
synced 2025-06-24 18:01:16 +02:00
manual / manpages: Adjust option filter filtering, move from C++ to Nix
Behavior change: Before we only showed uption if the command-specific options were non-empty. But that is somewhat odd since we also show common options. Now, we do everything based on the union of both sorts of options (with hidden-categories filtered, as before). Implementation change: The JSON dumping once again includes all options; the filtering of hidden categories is done in the Nix instead. This is better separation of "content" vs "presentation", and prepare the way for the HTML manual vs manpages / `--help` doing different things.
This commit is contained in:
parent
9c640c1229
commit
1d9fd3a6f8
2 changed files with 7 additions and 3 deletions
|
@ -75,10 +75,14 @@ let
|
|||
(details ? doc)
|
||||
(replaceStrings ["@stores@"] [storeDocs] details.doc);
|
||||
|
||||
maybeOptions = optionalString (details.flags != {}) ''
|
||||
maybeOptions = let
|
||||
allVisibleOptions = filterAttrs
|
||||
(_: o: ! o.hiddenCategory)
|
||||
(details.flags // toplevel.flags);
|
||||
in optionalString (allVisibleOptions != {}) ''
|
||||
# Options
|
||||
|
||||
${showOptions (details.flags // toplevel.flags)}
|
||||
${showOptions allVisibleOptions}
|
||||
|
||||
> **Note**
|
||||
>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue