On Fri, Mar 09, 2012 at 05:08:43PM -0500, Donald Allen wrote: > On Fri, Mar 9, 2012 at 4:40 PM, Ted Unangst <t...@tedunangst.com> wrote: > > On Fri, Mar 09, 2012, Donald Allen wrote: > >> OpenBSD's pride in its man pages is justified, for the most part. But > >> having recently decided to come back to OpenBSD after a long hiatus, I > >> found myself completely baffled by how to get battery status > >> information via sysctl(3). I use suckless.org's dwm and there's a > > > > I agree that the man page is unclear if you're unfamiliar with the > > subject, but adding an example for sensors will only help people who > > want to read that sysctl. Other nested sysctls are also kind of > > complicated. > > I don't see that as a reason not to begin by providing an example for > sensors, with others to follow. If you are concerned about the man > page becoming unwieldy, which I think is valid, then the examples > could be somewhere else, with a pointer in the man-page.
You example code is poort, since it reintroduces MAXSENSORDEVICES, which has been abolished for a reason. Tom many exmaplex clutter the manpages indeed. We have src, which is a fine set of examples. One minute of browsing through sysctl.c and I hit upon sysctl_sensors() and print_sensordev(). Which provide a good example, handle sensor devices at various depth in the tree, and are kept up to date if needed. -Otto > > > > > In almost every case, though, the sysctl program source should > > suffice. There are a few other man pages which advise the reader to > > refer to the source, so I think a short note along those lines would > > be best. > > I agree that pointers into the source would be useful, but see no > reason not have both those and examples. > > /Don