Skip to content

rg man page miscodes interior hyphens in long option names as unicode hyphen #3140

Closed

Description

@hmelman

Please tick this box to confirm you have reviewed the above.

  • I have a different issue.

What version of ripgrep are you using?

ripgrep 14.1.1

How did you install ripgrep?

homebrew

What operating system are you using ripgrep on?

macOS 15.6.1

Describe your bug.

I believe rg's man page miscodes hyphens within option names. Using Gnu man on mac the rg.1 man page shows switches as --case‐sensitive and --files‐without‐match where the leading hyphens are properly Ascii HYPHEN-MINUS #x2d but the interior ones are Unicode HYPHEN #x2010 which makes it difficult to search for the option name. (I think/hope this came through properly on GitHub).

What are the steps to reproduce the behavior?

$ gman rg

What is the actual behavior?

       --pre‐glob=GLOB
           This  flag works in conjunction with the --pre flag. Namely, when one or more --pre‐glob flags are given, then only files that match the given set of globs will be handed to the command specified
           by the --pre flag. Any non‐matching files will be searched without using the preprocessor command.

What is the expected behavior?

hyphen in switch names should be ascii hyphen-minus as you would type them so they can be cut and pasted to a command line.

Activity

  1. BurntSushi commented on Sep 6, 2025

    @BurntSushi
    Owner

    ripgrep does not do this. Something else is. It renders correctly as an ASCII hyphen in my man version 2.13.1. My man comes from the man-db package on Archlinux, whose homepage is: https://gitlab.com/man-db/man-db

    It also renders correctly using man on macOS. I don't have gman even though I have coreutils installed. I don't know how to install GNU man. All of the obvious searches don't show anything for me.

    And finally, to prove that ripgrep is not emitting some kind of weird hyphen, you can ask it to generate the man page:

    $ rg --generate man | rg pre-glob
    flag. One possible mitigation to this is to use the \fB\-\-pre-glob\fP flag to
    \fB\-\-pre-glob\fP=\fIGLOB\fP
    more \fB\-\-pre-glob\fP flags are given, then only files that match the given set
    then it is possible to use \fB\-\-pre\fP \fIpre-pdftotext\fP \fB--pre-glob
    Multiple \fB\-\-pre-glob\fP flags may be used. Globbing rules match
    
  2. added
    invalidAn issue that is not actually a bug or a feature that already exists.
    on Sep 6, 2025
  3. blyxxyz commented on Sep 6, 2025

    @blyxxyz
    Contributor

    In \-\-pre-glob the leading hyphens are escaped but the internal hyphen isn't.

    Seems like some roff implementations in some environments need all the hyphens to be escaped in order to stay ASCII: https://lists.gnu.org/archive/html/groff/2021-01/msg00074.html

  4. BurntSushi commented on Sep 6, 2025

    @BurntSushi
    Owner

    Wow, okay. Your link doesn't work, but it's an easy change on my end regardless.

  5. added a commit that references this issue on Sep 6, 2025
    35b01b6
  6. added
    bugA bug.
    rollupA PR that has been merged with many others in a rollup.
    and removed
    invalidAn issue that is not actually a bug or a feature that already exists.
    on Sep 6, 2025
  7. hmelman commented on Sep 6, 2025

    @hmelman
    Author

    Thanks for looking into this. Here are two references from debian:

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1052675

    https://lists.debian.org/debian-devel/2023/10/msg00085.html

    Yes it was brew install man-db and either I or it offered an option to install as gman.

  8. added a commit that references this issue on Sep 10, 2025
    21d98cf
  9. added 2 commits that reference this issue on Sep 19, 2025
    0c6edbb
    cdbff3b
  10. added a commit that references this issue on Sep 20, 2025
    74959a1
  11. added a commit that references this issue on Feb 8, 2026
  12. added a commit that references this issue on May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA bug.rollupA PR that has been merged with many others in a rollup.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions