DocServer2man

If you are on Mac OS X wouldn't be nice to type in the terminal:

man file.exists

and see this:

Well, now you can with the DocServer2man tool.

Installation

Download docserver.root from here.

In Frontier, install docserver.root in Guest Databases->www

In Radio, install docserver.root also in Guest Databases->www. Create the Guest Databases folder if it doesn't exists, and inside it, the www folder.

Update docserver.root, be patient, this can take a while.

Download DocServer2man 0.2 from here.

In Frontier, install DocServer2man in Guest Databases->apps->Tools

In Radio, install DocServer2man in the Tools folder.

For the DocServer2man menu to install, you have to restart Frontier (not needed for Radio).

You should see now a menu DocServer2man and a submenu Run.

Choose Run if you want to create the man pages from docserver.root.

You will then have the choice to use an existing man directory or to create one. I suggest you create a new man directory. I created mine in my home directory.

On my G4 400 MHZ, DocServer2man take around 60 seconds to extract and format the UserTalk verbs files for man. It write down first the verbs files to the man directory that have been choose and then, it pause while a perl script format the verbs files for man.

Using man

Important Note: All UserTalk verbs names are lower cased. So if you look for string.nthField, you will find nothing. But if you look for string.nthfield, you will get the man page.

If for example, you have created your man directory at ~/man, you can use this:

man -M ~/man/ file.exists

If your man directory is for example in the Dev directory in your home, you do this:

man -M ~/Dev/man/ file.exists

Its a little bit cumbersome to have to use the -M switch and the path.

Its better to put the path to your man directory directly in your shell configuration file, so man will already know where to look.

If you use a Bourne shell like bash or zsh, put this line in your configuration file if you have created your man directory in your home directory.

MANPATH=$MANPATH":$HOME/man"; export MANPATH

If you use a C shell like tcsh, you are out of luck with me because I don't remember the procedure. I will get back to you on that:). I'm sure somebody will be kind enough to refresh my memory.

Now restart your shell by opening a new terminal window and type:

man xml.decompile

You should see now the man page for xml.decompile.

If you don't want to use the terminal, you can use ManOpen which is an Aqua application on OS X. Just don't forget to add in the ManOpen's preferences the path to your man folder containing the UserTalk verbs.

Using other Unix tools

Having DocServer as texts files is quite a feast on OS X. You can use other tools beside man.

Use the cd command to go in your man directory.

Suppose now for example, I want to find all the strings verbs that have 'url' in their name. I just have to use the ls command like this.


% ls string.*url*

string.getfileurl.1 string.urldecode.1 string.urlencode.1 string.urlsplit.1

Now, suppose that I want to check for a specific word, for example "infinity". I can use grep.


% grep -i infinity *

clipboard.putvalue.1: clipboard.putValue (string (infinity)) coercion.binary.1: binary (infinity) coercion.long.1: long (infinity) coercion.number.1: number (infinity) coercion.single.1: single (infinity) file.filesinfolder.1: If level = infinity, it counts files at all levels, nesting file.filesinfolder.1: infinity) file.filesinfolder.1: file.filesInFolder ("System:System Folder:", infinity)

Have fun!


Version History

Version 0.2, April 11 2002

Fixed a bug involving AppleScript call to POSIX path. AppleScript version prior to 1.8.2 don't add a slash ('/') at the end of the path if the path is the path to a folder.

Version 0.1, April 10 2002

First release.

* Thanks to Steve Harley who helped to debug the Radio implementation.