when do you usually use the man page for a complex command line tool to answer a question you have? (like git, openssl, rsync, curl, etc)
(edit: no need to say "i use --help then man")
when do you usually use the man page for a complex command line tool to answer a question you have? (like git, openssl, rsync, curl, etc)
(edit: no need to say "i use --help then man")
i'm very curious about everyone who says "I'd look there first", if I want to figure out how to do something new I think I'll usually google how to do it rather than look at the man page, and then maybe later look at the man page to look up the details
(I've gotten enough of these answers:
- "I like that man pages don't require changing context"
- "with the man page I know I have the right version of the docs")
also it just occurred to me that the one time I wrote a command line tool (https://rbspy.github.io/) I didn't write a man page for it, I made a documentation website instead. I don't remember even considering writing a man page, probably because I rarely use man pages
(not looking to argue about whether command line tools "should" have man pages or not, just reflecting about how maybe I personally would prefer a good docs website over a man page. Also please no "webpages require internet")
@fanf @tartley @b0rk TIL that Git's -h and --help do different things. What an unfortunate UI though :( It goes completely against the principle of long options and the established behavior of -h/--help in every other CLI tool, and even the git(1) man page claims that -h and --help are identical??
Very useful to know though. Previously, I used tricks like "git remote blarg" to get the short help, and was a little confused/surprised that there was no better way to see the short help text.
@fanf @tartley @b0rk Oh, it's actually even worse! `git remote -h` shows the short help, but `git -h remote` outputs the man page.
`git remote --help`, `git --help remote`, and `git help remote` also all show the man page. So the specific spelling `git <command> -h` seems to be a special case. This is extremely unhelpful behavior for an option that's meant to be used when you don't know how to use a program... :(
@b0rk I've written a few command line tools over the years that launch a web broswer to display stuff.
I'll keep the idea of having a docs subcommand spawn a local web server and broswer to view guides, could be useful.
@b0rk I've written man pages before when building internal tools. It was fun learning the ROFF language or whatever. Part of my reluctance to do it with general tools is the requirement to install them as satellite files which is a bit of a pain when it comes to single binary downloads.
I know there's alternate locations you can put them, like /usr/local/man and even $HOME/.local/share/man the directory structure after that is also a bit of a pain. 😅 And then there's the need to remember to clean them up after the fact if you no longer use the tool.
It'd be neat if some of these apps had the ability to drop the files and a cleanup step to remove them so they could still be single binary. Another thought would be extending man to see if the the requested page is available normally, and if not, see if there's a binary in the path that matches that name? Maybe the man page could be embedded in another section so it didn't have to be executed to generate help? 🤔
@ednl yeah, I think the answer to "will there always be a way to get free and reliable static site for open source projects?" is not obvious
When I made that site it felt like github pages would be there forever, and maybe it still will, but I feel less certain of what the future of that looks like than I did.
@b0rk Back when I was a Debian developer, I wrote man pages for programs I packaged, since everything should have one (it's part of rhe packaging guidelines).
Some of the Debian man pages have made their way back upstream (not any of mine, that I am aware of).
I started using computers when they were not always online, so I grew up with local documentation as the primary source.
@b0rk I date from the days when man pages were a novelty.
If it doesn't have a man page, it isn't finished.
@b0rk One thing, and I don't know that this is solveable or maybe it was supposed to be solved by info pages but those were hard to memorize how to use, is learning the capabilities of a tool like...up front and at the top.
It's so hard to find the ingredients I need to concoct the correct incantation from man pages, even when I've done the thing with the tool before.
And sometimes you find things that SEEM like what you need but aren't.
@b0rk I have a lingering guilt about not going to man pages first, but often a blog post has been better crafted than the friendly manual. Not all manuals but enough to encourage an antipattern in search first.
I totally agree with your motivation to address/revaluate that.
@b0rk a general statement of when official docs feel not super helpful is when they clearly articulate what a tool does without managing to express why/when kinds of context.
A good blog post about a tool tells a story that docs don't tend to.
Why does `man stow` mention perl or Carnegie mellon's depo program? That man page is pretty good all around but does have stuff to skim over that doesn't feel like it's there in service of the user.
@RyanParsley either!
(it's a little hard for me to think about jq because I've completely given up on learning the jq language, but I don't think that has anything to do with the quality of the documentation)
@b0rk are you already familiar with https://tldr.sh/. I don't have it in my workflow, but seems like a neat idea to complement man pages.
Even if you have no interest in using it, perhaps it's existence and what's working there could be useful data.
@b0rk the man page for just is basically a less pretty help command :)
I suspect if people discover too many in a row like that and stop running that command.
@b0rk i remember this: when i learned about man and started using it, the stuff i wanted to know usually was on page 5 (quick reference / parameters). But i always forget that so it felt frustrating and abandoned them.
Instead I use --help command options. I only go to man when i want to learn the full and long version. But sometimes I do.
@b0rk I'm the kind of person who enjoyed reading man pages for leisure.
I read through the entirety of the rsync man page to compose my own favourite rsync invocation once.
The only tools where I resort to web search are shells, because their man pages are really hard to navigate (finding documentation for `read` in the bash man page is ... a nightmare).
Web search is often imprecise and as you note, has gotten so much worse that I am glad I never fully relied on it.
@b0rk The only reason why I'd use a search engine is to find where the manual is (e.g. what's the URL of the official Podman documentation again?). Top search results are just articles generated from obsolete Stack Overflow answers anyway. Otherwise I hope the man pages and --help give me the basics I need, and point me to more extensive documentation options if needed.
I picked "I'd look there first".
@b0rk I feel this. The part about search is the main point. keyword/regex search in man has always been a bit awkward even with helpers, google used to be great at bringing up the official site or man pages (which, even if it was for a diferent distro, at least help with context).
usually I try `-h` or `--help` first, then search, then man.
@b0rk One of the best features of the older man pages was a keyword-in-context index. See https://en.wikipedia.org/wiki/Key_Word_in_Context for an example.
If I thought of a word, I could see where it was used in man pages, and ONLY in man pages. Low noise, high granularity.
I'm tempted to make one as Appendix B of a small reference book I'm writing. I bet I can use my concordance file and grep for each of the words, reporting chapter instead of page in on-line formats.