XBoard interactive help

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: XBoard interactive help

Post by JoshPettus »

I tried "man -D -w" but unfortunately, it didn't work. It may be possible apple's version is anemic.

Code: Select all

man -D -w
man: invalid option -- D
man, version 1.6c

usage: man [-adfhktwW] [section] [-M path] [-P pager] [-S list]
	[-m system] [-p string] name ...

  a : find all matching entries
  c : do not use cat file
  d : print gobs of debugging information
  D : as for -d, but also display the pages
  f : same as whatis(1)
  h : print this help message
  k : same as apropos(1)
  K : search for a string in all pages
  t : use troff to format pages for printing
  w : print location of man page(s) that would be displayed
      (if no name given: print directories that would be searched)
  W : as for -w, but display filenames only

  C file   : use `file' as configuration file
  M path   : set search path for manual pages to `path'
  P pager  : use program `pager' to display pages
  S list   : colon separated section list
  m system : search for alternate system's man pages
  p string : string tells which preprocessors to run
               e - [n]eqn(1)   p - pic(1)    t - tbl(1)
               g - grap(1)     r - refer(1)  v - vgrind(1)
User avatar
hgm
Posts: 27837
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: XBoard interactive help

Post by hgm »

That is indeed completely different from what I get:

Code: Select all

hgm@hgm-xboard:~/fboard/xboard$ man --help
Usage: man [OPTION...] [SECTION] PAGE...

  -C, --config-file=FILE     use this user configuration file
  -d, --debug                emit debugging messages
  -D, --default              reset all options to their default values
      --warnings[=WARNINGS]  enable warnings from groff

 Main modes of operation:
  -f, --whatis               equivalent to whatis
  -k, --apropos              equivalent to apropos
  -K, --global-apropos       search for text in all pages
  -l, --local-file           interpret PAGE argument(s) as local filename(s)
  -w, --where, --location    print physical location of man page(s)
  -W, --where-cat, --location-cat
                             print physical location of cat file(s)

  -c, --catman               used by catman to reformat out of date cat pages
  -R, --recode=ENCODING      output source page encoded in ENCODING

 Finding manual pages:
  -L, --locale=LOCALE        define the locale for this particular man search
  -m, --systems=SYSTEM       use manual pages from other systems
  -M, --manpath=PATH         set search path for manual pages to PATH

  -S, -s, --sections=LIST    use colon separated section list

  -e, --extension=EXTENSION  limit search to extension type EXTENSION

  -i, --ignore-case          look for pages case-insensitively (default)
  -I, --match-case           look for pages case-sensitively

      --regex                show all pages matching regex
      --wildcard             show all pages matching wildcard

      --names-only           make --regex and --wildcard match page names only,
                             not descriptions

  -a, --all                  find all matching manual pages
  -u, --update               force a cache consistency check

      --no-subpages          don't try subpages, e.g. 'man foo bar' => 'man
                             foo-bar'

 Controlling formatted output:
  -P, --pager=PAGER          use program PAGER to display output
  -r, --prompt=STRING        provide the `less' pager with a prompt

  -7, --ascii                display ASCII translation of certain latin1 chars
  -E, --encoding=ENCODING    use selected output encoding
      --no-hyphenation, --nh turn off hyphenation
      --no-justification,                              --nj   turn off justification
  -p, --preprocessor=STRING  STRING indicates which preprocessors to run:
                             e - [n]eqn, p - pic, t - tbl,
g - grap, r - refer, v - vgrind

  -t, --troff                use groff to format pages
  -T, --troff-device[=DEVICE]   use groff with selected device

  -H, --html[=BROWSER]       use www-browser or BROWSER to display HTML output
  -X, --gxditview[=RESOLUTION]   use groff and display through gxditview
                             (X11):
                             -X = -TX75, -X100 = -TX100, -X100-12 = -TX100-12
  -Z, --ditroff              use groff and force it to produce ditroff

  -?, --help                 give this help list
      --usage                give a short usage message
  -V, --version              print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

Report bugs to cjwatson@debian.org.
hgm@hgm-xboard:~/fboard/xboard$ 
Weird thing is that it says -D does not exist, while D is in the list... But in any case, it would do something completely different.

So what happens if you do "man ls" or "man -w ls" from a terminal. Does that work? And when you would do system("man -w ls"); from XBoard, what does it say then?
User avatar
hgm
Posts: 27837
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: XBoard interactive help

Post by hgm »

I now pushed a patch to hgm.nubati that also handles adapter options in the Engine Settings dialog: all options starting with the name of the adapter (derived as the name of the binary that is actually executed, when this differs from the engine name given in the -fcp/scp option) will now consult the adapter manual. So clicking "Polyglot BookFile" in the Settings dialog of a UCI engine will now produce a help text!
User avatar
yurikvelo
Posts: 710
Joined: Sat Dec 06, 2014 1:53 pm

Re: XBoard interactive help

Post by yurikvelo »

hgm wrote:Weird thing is that it says -D does not exist, while D is in the list... But in any case, it would do something completely different.
man, version 1.6c is man-1.6g.dmg Mac OS X utility (Fedora Core 5 /repo/pkgs/man/man-1.6c.tar.gz)
it is 2005 version of `man

Your output looks like modern linux (Fedora 14, Ubuntu, Debian) `man 2010 or newer
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: XBoard interactive help

Post by JoshPettus »

hgm wrote: Weird thing is that it says -D does not exist, while D is in the list... But in any case, it would do something completely different.

I noticed that too, weird...
So what happens if you do "man ls" or "man -w ls" from a terminal. Does that work? And when you would do system("man -w ls"); from XBoard, what does it say then?
From the terminal it turns up with the ls manual.

From Xboard I did:

Code: Select all

if(currentCps) { // for engine options we have to look in engine manual
   snprintf(tidy, MSG_SIZ, "man -w ls");
   TidyProgramName(currentCps == &first ? appData.firstChessProgram : appData.secondChessProgram, "localhost", tidy+7);
   eng = BufferCommandOutput(tidy, MSG_SIZ);
   safeStrCpy(buf, eng, strlen(eng));
   DisplayNote(eng);
   return;
   FREE(eng);
   n = 1; 
It looks like it found a manual. (I didn't feed it fairymax's in any standard place) But I don't see the dialog popping up telling me what it found. (I can almost assume the ls manual which would be great) Any ideas?

[EDIT] I think it did popup but flickerd open for a quarter second and closed....
Last edited by JoshPettus on Thu Mar 17, 2016 2:52 pm, edited 2 times in total.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: XBoard interactive help

Post by JoshPettus »

hgm wrote:I now pushed a patch to hgm.nubati that also handles adapter options in the Engine Settings dialog: all options starting with the name of the adapter (derived as the name of the binary that is actually executed, when this differs from the engine name given in the -fcp/scp option) will now consult the adapter manual. So clicking "Polyglot BookFile" in the Settings dialog of a UCI engine will now produce a help text!
Great! Does that include the common engine options? It doesn't look like they are in the xboard manual at least.

Does UCI2WB have a manual? I think it only has one option in the engine settings dialogs anyway.
User avatar
hgm
Posts: 27837
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: XBoard interactive help

Post by hgm »

A lot ofoptions do not have a recognizable header in the XBoard manual. This is why we will have to do a rewrite/reorganize.

UCI2WB is indeed very simple. It should ahve a manual, I will address that too.
User avatar
hgm
Posts: 27837
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: XBoard interactive help

Post by hgm »

JoshPettus wrote:

Code: Select all

if(currentCps) { // for engine options we have to look in engine manual
   snprintf(tidy, MSG_SIZ, "man -w ls");
   TidyProgramName(currentCps == &first ? appData.firstChessProgram : appData.secondChessProgram, "localhost", tidy+7);
   eng = BufferCommandOutput(tidy, MSG_SIZ);
   safeStrCpy(buf, eng, strlen(eng));
   DisplayNote(eng);
   return;
   FREE(eng);
   n = 1; 
Oh, this won'twork because the "ls" will be overwritten by the TidyProgramName (at tidy+7). Just comment out that TidyProgramName line.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: XBoard interactive help

Post by JoshPettus »

perfect!
I got
/usr/share/man/man1/ls.1.gz from xboard which is the same as terminal


Which is good, but on osx, most users don't compile their own engines, or use install scripts. So I still think we should check the engine directory as last resort, if possible. (assuming greatly the manual is in a format xboard can parse, which practically may only be the manuals you write... :()
User avatar
hgm
Posts: 27837
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: XBoard interactive help

Post by hgm »

So how do people install software on OSX? There are no repositories supplying ready-to-run binary packages?

I think this will be a rather hopeless endeavor if there is not some form of standardization we can draw on. And I seriously doubt it is worth the effort to try supporting non-compliant stuff. Unless the parties distributing the engine will make a serious effort, the chances that it will work are miniscule. Any documentation will have to be in man format, or XBoard would not be able to recognize the headers and dilimiters of the text to print. The documentation will need to describe every option, with a header identical to the option name. (And no engine manual I have seen does actually describe any of its UCI options. Surprisingly the Polyglot manual was nearly perfect in this respect.)

I am also not sure whether we should encourage people not to compliantly install. The Linux system now is based on the plugin standard, where installing is the only thing the user will have to do, and the .eng files then will cause auto-registration with XBoard (or other GUIs). Not installing would force users to register by hand through the Load Engine dialog. If that is the way we want to replace proper installation on OSX, we should let it take care of correctly activating the manual too.