Should I put the man file as /usr/local/man/man6/fairymax.6? or will it find fmax.man in the engine directory?
[EDIT]
neither seem to work..hmm..
XBoard interactive help
Moderator: Ras
-
- Posts: 28390
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: XBoard interactive help
What if you put it in the same directory as the xboard man file?
-
- Posts: 730
- Joined: Fri Oct 19, 2012 2:23 am
Re: XBoard interactive help
interesting, it finds it! So the system usr man directory isn't part of the search?
-
- Posts: 730
- Joined: Fri Oct 19, 2012 2:23 am
Re: XBoard interactive help
I just realized, that this can't be some random behavior of man, but this all must be by design from gtk. I use a special gtk2 installation meant for use in app bundles. That way gtk can find it's own localization files in the bundle rather then search the system. I bet the gtk man file was suppose to be used in this way as well. This also explains why man -w xboard didn't work when I launched the executable directly, (as oppose to launching the app normally). Directly means that the OS doesn't send whatever signal gtk uses to find these resources, so it fails.
If this is really the case then getting the man page from "man -f executable" is fine because gtk made it so.
As a result though, it won't scan the system for man files anyway, which could be a pain for makefile installed engines. I guess recursively checking the engine folder (in case it's in some sub folder called data or such) is our best option.
If this is really the case then getting the man page from "man -f executable" is fine because gtk made it so.
As a result though, it won't scan the system for man files anyway, which could be a pain for makefile installed engines. I guess recursively checking the engine folder (in case it's in some sub folder called data or such) is our best option.
-
- Posts: 28390
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: XBoard interactive help
I think it should work in any case for manuals that are installed in a compliant way.
It seems the man command is a bit more complex than I imagined. It makes use of an 'index database', rather than just searching for files of the given name. This is probably why it can find 'maxqi'. After copying a man page to the appropriate place in the $(mandir) tree, you are supposed to run the 'mandb' command to notice the new page and add it to the database. Fairy-Max' make install does not do that, possibly explaining why it couldnot find the fairymax page.
There also is an environment variable $MANOPT that supplies extra options to 'man'.
It seems the man command is a bit more complex than I imagined. It makes use of an 'index database', rather than just searching for files of the given name. This is probably why it can find 'maxqi'. After copying a man page to the appropriate place in the $(mandir) tree, you are supposed to run the 'mandb' command to notice the new page and add it to the database. Fairy-Max' make install does not do that, possibly explaining why it couldnot find the fairymax page.
There also is an environment variable $MANOPT that supplies extra options to 'man'.
-
- Posts: 730
- Joined: Fri Oct 19, 2012 2:23 am
Re: XBoard interactive help
I think apple may have crippled a few of these commands for their own technologies. locate uses a /var/db/locate.database instead of the index database and is disabled by default and there is no mandb command...
-
- Posts: 28390
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: XBoard interactive help
Well, that would explain why it needs so much time to do the initial "man -w xboard". Without index database it would have to search the entire man sub tree.
Nevertheless, for standard commands, and for compliantly installed engines, the man command should work from a terminal. If it doesn't work when called from XBoard, it must be because some environment variables (like $MANOPT) overrule the normal search path. But there are option that mahe it ignore such overrules, and XBoard could call it with those to find the same man pages as it would find when run from the command line.
Nevertheless, for standard commands, and for compliantly installed engines, the man command should work from a terminal. If it doesn't work when called from XBoard, it must be because some environment variables (like $MANOPT) overrule the normal search path. But there are option that mahe it ignore such overrules, and XBoard could call it with those to find the same man pages as it would find when run from the command line.
-
- Posts: 730
- Joined: Fri Oct 19, 2012 2:23 am
Re: XBoard interactive help
oh good, that sounds fine
-
- Posts: 28390
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: XBoard interactive help
What happens when you replace in the following code in DisplayHelp()
"man -w " by "man -D -w"? Can it find the engine manuals in the standard place, then? You could put
DisplayNote(eng);
return;
just before the FREE to see what it found.
Code: Select all
if(currentCps) { // for engine options we have to look in engine manual
snprintf(tidy, MSG_SIZ, "man -w ");
TidyProgramName(currentCps == &first ? appData.firstChessProgram : appData.secondChessProgram, "localhost", tidy+7);
eng = BufferCommandOutput(tidy, MSG_SIZ);
safeStrCpy(buf, eng, strlen(eng));
FREE(eng);
n = 1;
DisplayNote(eng);
return;
just before the FREE to see what it found.
-
- Posts: 28390
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: XBoard interactive help
I updated Fairy-Max' man page so that all options have an individual item. And I pushed an XBoard patch that will recognize the item headers in man files produced through pod2man. This should make all help clicks on Fairy-Max' Engine Settings dialog provide sensible info.