nix icon indicating copy to clipboard operation
nix copied to clipboard

Flake evaluation options documented in help strings are retaining html tags

Open oxcabe opened this issue 9 months ago • 4 comments

Problem

Using nix (Nix) 2.18.1.

The Options section in the nix flake <command> --help message is preserving the HTML tags. e.g. running nix flake new --help will print the following at the end of the help message:

Options

    · <span id="opt-template">--template</span> / -t template

      The template to use.

    Common evaluation options:

    · <span id="opt-arg">--arg</span> name expr

      Pass the value expr as the argument name to Nix functions.

    · <span id="opt-argstr">--argstr</span> name string

      Pass the string string as the argument name to Nix functions.

    · <span id="opt-debugger">--debugger</span>

This could be caused by the manpages generation script not properly removing HTML tags.

This code seems relevant, too:

  • https://github.com/NixOS/nix/blob/4161f3cfea10e77ad04cc189affeb5291c66c156/src/libcmd/common-eval-args.cc

Proposal

  1. Figure out where the help message template is.
  2. Strip the HTML tags when creating manpages.

Checklist

Priorities

Add :+1: to issues you find important.

oxcabe avatar Apr 29 '24 12:04 oxcabe

I want to contribute a PR to fix this issue, in case it's considered a valid concern :+1:

oxcabe avatar Apr 29 '24 12:04 oxcabe

This seems to be fixed on master (maybe because the lowdown dependency got updated?).

edolstra avatar Apr 30 '24 08:04 edolstra

Actually I can't reproduce it on 2.18 either, e.g.

nix run nix/2.18.2 -- flake new --help

shows

    · --template / -t template The template to use. 

    Common evaluation options:

    · --arg name expr Pass the value expr as the argument name to Nix functions.

    · --argstr name string Pass the string string as the argument name to Nix functions.

edolstra avatar Apr 30 '24 08:04 edolstra

It might just be a me thing then. I'll look further into it.

oxcabe avatar Apr 30 '24 08:04 oxcabe

I wasn't able to figure out what happened. Closing this for now.

oxcabe avatar May 23 '24 19:05 oxcabe