In HTML output, definitions for flags, environment variables, and other such things are converted to hyperlinks, and hyperlinks can point directly to them. https://man.openbsd.org/ssh#D
In terminal output, this same capability is used to create a ctags file, which is supported by less(1). On OpenBSD, I can type “man ssh”, then :tD to jump to the tag named “D”.
This relies on the mdoc(7) language’s semantics, so unfortunately it won’t work for manpages using the older man(7) macros. But nearly all BSD manpages are written in mdoc(7), and a significant minority of manpages from packages.
And of course, even if your pager isn't `less`, by the time the content has been fed through `man` itself it's been crunched into a terminal representation, not a semantic representation. You'd have to `man -w whatever` to get the raw file and parse it yourself (and handle whether it's mdoc or man format, etc.).
The regex you have keyed that matches to "What these flag definitions usually look like on the terminal" is almost certainly the saddle-point solution between using the tooling as it is and burning it to the ground to build something better.
man ffmpeg "-ss"
And have it jump right to the -ss option so I can see the expected format. For me the 99+% use case of man is to look up parameters of a command line or parameters of a programming function call. It's shocking that the UX for what I presume is the single most used use case is so broken.For options, the first hit often is the description. When it's not, filtering with & can give you an idea how much further it is, so you can repeat the search with n.
It's not an exact, "semantic" jump, but I find it good enough.
In those systems there were far fewer tools, far fewer options, and much simpler workflows, so honestly I didn’t need to endlessly flip through manpages to sift out hundreds of options with arcane, incompatible, unintuitive syntaxes. The few options we needed to memorize were always paired with consistent syntax and impeccable mnemonics to remember (who can forget ‘ls -l‘ or ‘rm -f‘?)
Ironically, ‘vi‘ was already quite evolved, complex, and arcane by this point, but that was completely different: it was required for us to acquire proficiency in order to code, and it was easy to build skills from basic to expert/power, and all ‘vi‘-editing commands still featured those standardized mnemonics and consistency that can only come from a proprietary single-entity codebase. Plus all possible legacy compat with ‘ed‘ which nobody used directly anymore!
So while we may today consider this a lacuna in the reader tool, it wasn’t by design, and I blame the explosion of “GNU long options” and lack of standardization, more than anything. But also ‘tar‘ and ‘ps‘ and BSD vs. the world. Eff those guys.
https://man.openbsd.org/signify.1
https://www.gnupg.org/documentation/manuals/gnupg24/gpg.1.ht...
Oops, sorry, this is GNU software, so we need the real documentation from texinfo:
https://www.gnupg.org/documentation/manuals/gnupg/
GnuPG certainly has more features. Does that make it better software? For checking signatures (the only thing I’ve used GnuPG for in 15 years), I find the signify(1) documentation more readable and the signify(1) tool more usable.
Or how about tar(1), everyone’s favorite punching bag due to its weird options?
https://manpages.debian.org/bookworm/tar/tar.1.en.html
https://www.gnu.org/software/tar/manual/tar.html
Yikes!
No affiliation, just an avid user.