3

Guidance on man pages for the GNU project is wild

 8 months ago
source link: https://social.jvns.ca/@b0rk/111607416578693170
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Julia Evans: "this guidance on man pages for…"

this guidance on man pages for the GNU project is wild https://www.gnu.org/prep/standards/html_node/Man-Pages.html

(they seem to think everyone should use info pages instead, which I personally have never used despite having used GNU tools for 20 years)

In the GNU project, man pages are secondary. It is not necessary or expected for every GNU program to have a man page, but some of them do. It’s your choice whether to include a man page in your program.  When you make this decision, consider that supporting a man page requires continual effort each time the program is changed. The time you spend on the man page is time taken away from more useful work.

@b0rk I somehow expected the second paragraph to go "instead, we encourage you to write an info page", but uh, this is essentially saying "yeah, we don't need docs, docs aren't useful work".

@zhenech oh they do encourage you to make info pages later on, I just think that's kind of an absurd approach because I literally did not know info pages existed for the first 15 years I used GNU tools, and I've still never used one

@b0rk @zhenech
GNU did this incredibly *damaging* thing that was
- deliberately putting out empty manpages that just said "you should check the info page for this program"
- *NOT HAVING CONTENT IN THE RELATED INFO PAGE*

Seriously. These guys.

@adriano @b0rk @zhenech None of that is true. We spent a considerable amount of time writing help2man so that you could get decent man pages without us duplicating work we already did. Not having content in related info pages .. blame your distribution, not our fault.

@egallager @adriano @b0rk @zhenech @wesnoth Immediate guess, the long options you have are missing a equal sign. The argument to said long options is also in lower case. Consider "--validate-schema arg" vs "--block-size=SIZE" from GNU ls. Long options should generally require an equal sign between argument an option.

@egallager @adriano @b0rk @zhenech @wesnoth Additionally, stuff like:

-v [ --version ] prints the game's version number and exits.

is sorta "weird" from a user perspective, "is --version optional to -v?" -- normally you'd something like

-w, --width=COLS set output .....

@egallager @adriano @b0rk @zhenech @wesnoth But looking at the thread, maybe messages going to stderr?

Maybe I should install Wesnoth and just stop asking questions! 😉

@amszmidt

@adriano is 100% correct. There were info pages that were effectively content free and there were manpages that had only a pointer to the useless info pages. Don't blame the distros. They packaged the info pages straight from GNU. Some of those pages were just useless.

@dmaonR @amszmidt @adriano Debian only packaged the info pages in non-free due to licensing issues. You usually had to install them separately. If you didn’t, the “info” page just gave you a copy of the (useless) manpage.

@wim @dmaonR @adriano That was one thing (not all the manuals though ended up under non-free); the other was that you generally had to install FOO-doc, which also did not populate the "top file" with correct entries, so @b0rk issue of navigating to say xargs, didn't work (we made this easier for distributions improving the #GNU Texinfo).

Even the feature where info shows man pages was to make users happy -- better have something than nothing. Can't make everyone happy...

@amszmidt @wim @dmaonR @b0rk

So, if I get this straight, from these quotes:
"Debian only packaged the info pages in non-free due to licensing issues"
and
"you generally had to install FOO-doc, which also did not populate the "top file" with correct entries"

You invented a new system of documentation which required extra work for the common user, forced distros to consider licensing issues, did not work correctly when installed from a secondary package, *but the fault is the distros'*

@amszmidt @wim @dmaonR @b0rk Again, I'm sure you did and do great work, this is not sarcasm, but you're arguing against the context of a page your org wrote that says "writing docs takes time that you could be using to do actual work".

@adriano @wim @dmaonR @b0rk That is not what the policy says, we do not want to DUPLICATE work by writing the same information in man pages when we already have a manual that we wrote.

@adriano @wim @dmaonR @b0rk Info pages are older than man pages (the format dates back to ITS on the PDP-10). Nobody forced anyone, talk about inventing excuses mate...

@amszmidt @wim @dmaonR @b0rk

Ok, you *pushed an alternative documentation system*, sorry.

@adriano @wim @dmaonR @b0rk You mean like .. you're pushing an alternative documentation system, man pages, onto us? There are technical reasons why we prefer texinfo (this has really nothing to do with info pages).

@adriano @amszmidt @wim @dmaonR @b0rk this is the most FOSS thread I’ve read in weeks 😂

I vaguely remember coming in contact with info pages ca. 2002 and wondering, “why did they replace archaic, confusing thing with a different archaic, confusing thing, made it incompatible, and then barely marketed it?”

Not shocked to see none of that has changed in the intervening two decades.

@adriano @b0rk @zhenech this RIGHT HERE is why I quickly gained a hatred for info pages. I felt that documentation was being withheld; seems that it wasn't just me.

Debian went to the effort to correct this somewhat. It's not exciting work, but someone recognized that it's important work and is worthy of effort.

@adriano @b0rk @zhenech
> - deliberately putting out empty manpages that just said "you should check the info page for this program"

I'd forgotten about this, but the past rage came roaring back when I read that, lol

@adriano @b0rk @zhenech seems like people who should probably run the world, seems good and sane 🫠

@b0rk I have a total n00b question. Please go easy on me here folks. I've only been using Unix based command line programs for for... ummm... 30 years.

How do I view the info page?!?!? What is even an info page?

@zhenech

@sysop408 @zhenech no it's a great question! You can theoretically view them on linux with `info grep` but it sucks. Apparently there's an HTML view on the internet at https://www.gnu.org/software/grep/manual/grep.html

@b0rk I wrote my first Web page using Emacs over dial-up to be viewed by NCSA Mosaic browsers. I can't believe that today is the first time I've ever accessed an info page. Awesome!

It's interesting that info appears to have no dependency on locally installed programs whereas man only gives you documentation bundled with your installed tools.

Like you said, kinda odd that they haven't updated this policy. Whatever the original point was, seems to have been lost to time.

I guess someone decided man hill was the hill he wanted to die on and for purposes of humor, I do hope it was a *he*.

@zhenech

@sysop408 @b0rk @zhenech I can tell just by the writing style that this was one of RMS's personal hobbyhorses.

The saddest thing about the whole situation, to my mind, is that some of the GNU info manuals are really good, if considered on their own terms. When I was teaching at CMU I found it was often helpful to point students at specific sections of <https://sourceware.org/glibc/manual/html_node/index.html>, for instance. And I have heard that the FSF actually used to fund technical writers to write them, which, if it's true, I wish they hadn't given up on it.

@zwol yeah it really feels like if there were more investment in discoverability they could be useful

@b0rk I'm glad you're getting some of @zwol 's opinions on this as he's one of the people I trust most at this particular intersection of expertise

@b0rk @zwol Back in the day, there was an attitude of "release it, let somebody else document it, then sell the docs." That's where O'Reilly started.

@zwol what's supposed to be the difference between a man page and an info page? Just from the few that I sampled, I gather that today that the info page is the man page expanded to include additional info that's not specific to usage commands.

I guess it seems to me that the man page is more of an info sheet and the info page is actually a manual. Is that how it always was?

@b0rk @zhenech

@sysop408 @b0rk @zhenech Individual man pages can be a bunch of different things. The *collection* of all man pages, however, was originally intended to be a comprehensive *reference* manual for Unix. This means a good manpage is written with the expectation that people are going to read just one or two manpages at a time, and also that readers already basically know what the thing is for and want to be reminded of all the details.

To get a sense for what people often find lacking in manpages converted from command --help output, compare <https://man7.org/linux/man-pages/man1/ls.1.html> (generated from ls --help) with <https://man.freebsd.org/cgi/man.cgi?query=ls&apropos=0&sektion=1&manpath=FreeBSD+14.0-RELEASE+and+Ports&arch=default&format=html> (written by hand by someone steeped in the tradition of manpages).

@zwol this is starting to make sense. Thanks for staying with me on this.

It makes perfect sense to me that a man page is supposed to be a quick reference that could be compiled to be part of a much larger volume and an info page should be something that stands on its own. Was there a very practical 1980's reason for that level of hostility toward man pages or was it really just an ideology that condensed info is a waste of resources?

@b0rk @zhenech

@sysop408 @b0rk @zhenech I do not know for certain, but I think a lot of it was that RMS thought the *source format* for manpages was really painful to write, and he thought GNU contributors would be more willing to work on Texinfo format manuals.

In general, the people who worked on GNU in the early years had no hesitation to declare that some existing thing about Unix was bad and they had a better idea. Sometimes they were right (yes, all programs _should_ be able to handle arbitrarily long lines of text) and sometimes they antagonized everyone who liked the existing thing (vi versus emacs). And sometimes, they were right as far as their thinking went, but ignored another class of problems that were just as significant: sure, Texinfo is easier to *write* than troff -man or -mdoc, but nobody likes that standalone "info" reader, and the *structure* of Texinfo documentation makes it hard to provide the same ease of looking up things in the index as you get from "man".

(Have a skim through https://github.com/besser82/libxcrypt/blob/develop/doc/crypt.3 to get a sense for what writing troff-format documentation is like -- and be aware that this is the newer, slightly less painful "mdoc" notation.)

Extended crypt library for descrypt, md5crypt, bcrypt, and others - besser82/libxcrypt

@zwol appreciate you sharing all this information about the history of reference documentation, I'm learning a lot

@zwol @sysop408 @b0rk @zhenech oh yeah, help2man is alful, and mdoc(7) pages are also so much nicer on the eyes and even contain semantic markup…

@zwol @sysop408 @b0rk @zhenech yeah, the CVS(GNU) texinfo manual is a complete book (the “Cederqvist”), it’s really good, and the manpage is mostly autogenerated and suffers from not even being complete :( I need to write one by hand some day…

@b0rk

Terminal only:

info [command] --subnodes --output - | less

info tar --subnodes --output - | less

@sysop408 @zhenech

@b0rk @sysop408 @zhenech konqeror browser used to have builtin `info:grep` support in the address bar and you could click to navigate the pages it rendered. The chapters and links seem to be the main differentiation from a manpage. I started Linux with dial-up internet (8 debian floppies and a 486) and learned a lot with `apropos` or `... --help| less` and the installed docs.

@b0rk @sysop408 @zhenech
the *one* thing I do like about info is that it has internal hyperlinks, which can be quite the convenience booster. But, eh.

@b0rk @sysop408 @zhenech How is there no mention of `info grep` on the `grep --help` output??
`man grep` does include a pointer to `info grep` at the bottom, though.

@b0rk @sysop408 @zhenech info always seemed to demand emacs keybindings, so I used man pages instead

there were definitely some where the info pages were more complete than the man pages

At this point I used AsciiDoc for everything it and it can make man pages, so it seems I chose correctly all those years ago :)

@b0rk @sysop408 @zhenech i have known about info pages for about 30 years but still haven't read one for more than 20 years. i got curious as to how they appear now. so i tried `info grep` on my mac; to my surprise it works…

and shows me the BSD man page, lol (with the highlighting removed). Nothing else about info seems to changed, including info’s own note about itself that it doesn’t support the mouse (still true in 2023).

@drj info was preinstalled on Darwin? It didn't work for me. I had to login to my CentOS server to try it.

@b0rk
@zhenech

@sysop408 @b0rk @zhenech The only decent info reader is Emacs (`C-h i` to list all info pages on your system). The info command honestly sucks. I think these are literally the only info readers in existence.

@flamingos_cant @sysop408 @b0rk @zhenech I've only started to seldom peruse info pages after discovering pinfo, a good 5 or 6 years after my first Linux install. You can find it here: https://github.com/baszoetekouw/pinfo — and it can even render man pages and navigate around them. The key bindings are similar to Lynx and much more reasonable than those of GNU info and it uses colors while being smaller than the bloated GNU offering 👏

Console-based info reader. Contribute to baszoetekouw/pinfo development by creating an account on GitHub.

@b0rk @zhenech I know about info pages, but I always use man pages instead because I never bothered understanding how to navigate info pages.

@b0rk

Same. They (probably RMS) have always insisted on this as a religious point, even after the ship clearly sailed.

Another case of a personal programming preference being elevated to dogma.

@dadregga @b0rk

Woah, what the heck is an "info page" ? I feel like it's always going to be work to maintain documentation. Is it some kind of auto generated doc?

@omarshehata @dadregga @b0rk No, it's just an early, primitive attempt at hypertext that originated (I think) in the early-1980s MIT hacker culture. Also used as an excuse to write a rambling, garrulous tome in place of a few compact paragraphs.

@oclsc @dadregga @b0rk

I hope to never encounter a rambling garrulous tome while trying to debug something, but now I kind of really want to look one of these up for some weekend leisurely reading 😅

I feel like there must be some fun fascinating cultural gems in there

@omarshehata @dadregga @b0rk Indeed. Long, detailed, even stream-of-consciousness docs have a place. But they're no replacement for cat(1).

@b0rk Good thing that advice is ignored by most people.

@b0rk the trick with gnu is to learn what is good and what should just be ignored. This is just super bad advise.

@bdha @b0rk But…but…wouldn't supporting info pages require even *more* continual effort?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK