Index: /trunk/Ohana/src/opihi/cmd.basic/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/Makefile	(revision 4685)
+++ /trunk/Ohana/src/opihi/cmd.basic/Makefile	(revision 4686)
@@ -51,4 +51,5 @@
 $(SDIR)/usleep.$(ARCH).o     \
 $(SDIR)/sleep.$(ARCH).o	     \
+$(SDIR)/version.$(ARCH).o    \
 $(SDIR)/wait.$(ARCH).o	     \
 $(SDIR)/which.$(ARCH).o
Index: /trunk/Ohana/src/opihi/cmd.basic/help/!
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/!	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/!	(revision 4686)
@@ -0,0 +1,6 @@
+
+  exec (line)
+
+  perform a system call.  this can also be invoked with "!".  
+  don't use ! in a macro or input script as it is interpreted as a
+  comment character. 
Index: /trunk/Ohana/src/opihi/cmd.basic/help/Opihi
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/Opihi	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/Opihi	(revision 4686)
@@ -0,0 +1,5 @@
+
+
+    Opihi
+
+  
Index: /trunk/Ohana/src/opihi/cmd.basic/help/Shell
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/Shell	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/Shell	(revision 4686)
@@ -0,0 +1,5 @@
+
+
+    Opihi
+
+  
Index: /trunk/Ohana/src/opihi/cmd.basic/help/Variables
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/Variables	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/Variables	(revision 4686)
@@ -0,0 +1,17 @@
+
+  Opihi shell variables (scalars):
+
+  The Opihi shell can have variables which are designated by a word
+following a dollar sign: $foo.  Certain Mana function create and set
+variables (ie, stats, cursor).  You can also set a variable to the
+result of an arithmetic expression or just a number like this:
+
+  $foo = 10.0
+  $bar = 5*$foo + 0.6
+
+Mana will replace the variables on a line before executing a command.
+See also "Math" for more description of arithmetic operations.
+
+  See Also:  Math
+
+
Index: /trunk/Ohana/src/opihi/cmd.basic/help/break
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/break	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/break	(revision 4686)
@@ -0,0 +1,7 @@
+
+  break
+
+  halts macro, if, or for processes and returns to the basic prompt.
+
+  See also: macro, if, for
+
Index: /trunk/Ohana/src/opihi/cmd.basic/help/cd
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/cd	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/cd	(revision 4686)
@@ -0,0 +1,9 @@
+
+   cd (path)
+
+   change current working directory. 
+
+   Note that Kii or Kapa will be launched in the original 
+   directory, which means PS files created by Kii or Kapa 
+   will land in that directory (perhaps an unexpected result).
+
Index: /trunk/Ohana/src/opihi/cmd.basic/help/echo
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/echo	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/echo	(revision 4686)
@@ -0,0 +1,10 @@
+
+  echo [anything]
+
+  prints the rest of the line, after variables and math expressions
+are parsed.  
+
+
+  See Also:  Opihi, math
+
+
Index: /trunk/Ohana/src/opihi/cmd.basic/help/exec
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/exec	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/exec	(revision 4686)
@@ -0,0 +1,6 @@
+
+   exec (or !) system function
+
+   perform a UNIX system call.  variables are parsed before 
+   the commands is passed to the UNIX shell.
+
Index: /trunk/Ohana/src/opihi/cmd.basic/help/for
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/for	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/for	(revision 4686)
@@ -0,0 +1,19 @@
+
+   for var (start) (stop) [delta]
+
+    perform a loop, with $var as the loop variable. 
+    the value of $var runs from (start) to (stop) inclusive, 
+    and is incremented by [delta] (1 by default).
+
+    The loop commands are entered until the appropriate "end" is typed;
+    if there are nested loops, macro definitions, or logical blocks,
+    the correct "end" is used!
+
+    for may be used at the command line, in a macro, or in an input
+    file with no ill effects.
+
+    the variable $var may be accessed during the loop execution.  if
+    the variable $var is assigned a value beyond (stop) during the
+    loop, the loop execution will end.
+
+    See also: macro, if
Index: /trunk/Ohana/src/opihi/cmd.basic/help/help
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/help	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/help	(revision 4686)
@@ -0,0 +1,7 @@
+
+   help (function)
+
+   print the contents of the help file.  
+   typing "help" without an argument will list the available help
+   files.  
+
Index: /trunk/Ohana/src/opihi/cmd.basic/help/if
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/if	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/if	(revision 4686)
@@ -0,0 +1,22 @@
+
+   if (logic)
+     (commands)
+   end
+
+   or:
+
+   if (logic)
+     (commands)
+   else 
+     (commnds)
+   end
+
+   logical block.  The commands are performed subject to the logical
+   condition.  The syntax is simplified C:  
+   examples: (x = 6), (x < 6) , (x ! 6), ((x = 6) | (x > 10))
+
+   there are no delimiter characters.
+
+   See also: for, macro
+
+   
Index: /trunk/Ohana/src/opihi/cmd.basic/help/input
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/input	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/input	(revision 4686)
@@ -0,0 +1,15 @@
+
+   input (filename)
+
+   execute a series of commands given in the file.
+
+   Two special examples:  
+   ~/.manarc is loaded on startup, which give the user a place to
+   define personal macros, or interesting variables, etc.
+
+   If mana is called in the form "mana file", the file is loaded
+   (after .manarc) before the user is given the command-line prompt.
+   This can be used to invoke mana in a shell script, but care should
+   be taken in a shell-script that the file ends with the word "exit"
+   or "quit", or strange things may happen...
+
Index: /trunk/Ohana/src/opihi/cmd.basic/help/macro
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/macro	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/macro	(revision 4686)
@@ -0,0 +1,11 @@
+
+   macro (name)
+
+   create a macro.  the commands are entered until the word 'end' is
+   reached.  nested if, for, and macro definitions use the
+   appropriately matched occurances of the 'end'.
+
+   Within a macro, the command-line arguments are refered to as $1,
+   $2, etc.  The number of command-line arguments is given by $0.
+
+   
Index: /trunk/Ohana/src/opihi/cmd.basic/help/memory
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/memory	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/memory	(revision 4686)
@@ -0,0 +1,12 @@
+
+  memory [x]
+
+  list the currently used memory.  This gives a (possibly very) long
+  listing of the size of every allocated piece of memory.  Placing
+  anything after the word "memory" gives a summary also.  This is
+  useful to see just how close you are to filling your computer's
+  entire memory (Does not include memory allocated to Kii!)
+
+  See Also: buffers
+
+
Index: /trunk/Ohana/src/opihi/cmd.basic/help/output
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/output	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/output	(revision 4686)
@@ -0,0 +1,10 @@
+
+  output (filename or "stdout")
+
+  redirect the output to a file (concat to the end of the file).  This
+  can also be done with the UNIX ">".  However, this command is useful
+  to send information to a file for a part of a Mana session.  For
+  example, you can save results of a "stats" command.
+
+  See Also: input, stats
+
Index: /trunk/Ohana/src/opihi/cmd.basic/help/pwd
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/pwd	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/pwd	(revision 4686)
@@ -0,0 +1,5 @@
+
+   pwd
+
+   print current working directory
+
Index: /trunk/Ohana/src/opihi/cmd.basic/help/scan
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/scan	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/scan	(revision 4686)
@@ -0,0 +1,5 @@
+
+   scan (filename) (variable) [Nline]
+
+   place the Nth line in the file in the named variable
+
Index: /trunk/Ohana/src/opihi/cmd.basic/help/wait
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/wait	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/wait	(revision 4686)
@@ -0,0 +1,5 @@
+
+  wait [anything]
+
+  wait echos the rest of the line and waits for <return> to be typed.
+Very useful for pausing the processing of an input file or a macro.
Index: /trunk/Ohana/src/opihi/cmd.basic/help/which
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/help/which	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/help/which	(revision 4686)
@@ -0,0 +1,5 @@
+
+   which (command)
+
+   give a short summary info line on a command
+
Index: /trunk/Ohana/src/opihi/cmd.basic/init.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/init.c	(revision 4685)
+++ /trunk/Ohana/src/opihi/cmd.basic/init.c	(revision 4686)
@@ -31,4 +31,5 @@
 int substr_func     PROTO((int, char **));
 int wait       	    PROTO((int, char **));
+int version    	    PROTO((int, char **));
 int which      	    PROTO((int, char **));
 
@@ -66,4 +67,5 @@
   {"strlen",        strlen_func,        "string length"},
   {"substr",        substr_func,        "substring"},
+  {"version",       version,            "list version information"},
   {"wait",    	    wait,               "wait until return is typed"},
   {"which",   	    which,              "show command *"}
Index: /trunk/Ohana/src/opihi/cmd.basic/version.c
===================================================================
--- /trunk/Ohana/src/opihi/cmd.basic/version.c	(revision 4686)
+++ /trunk/Ohana/src/opihi/cmd.basic/version.c	(revision 4686)
@@ -0,0 +1,13 @@
+# include "basic.h"
+static char *name = "$Name: not supported by cvs2svn $";
+
+int version (int argc, char **argv) {
+
+  fprintf (stderr, "%s\n", name);
+
+  fprintf (stderr, "%s\n", ohana_version());
+  fprintf (stderr, "%s\n", fits_version());
+
+  fprintf (stderr, "compiled on %s %s\n", __DATE__, __TIME__);
+  return (TRUE);
+}
Index: /trunk/Ohana/src/opihi/pantasks/Makefile
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/Makefile	(revision 4685)
+++ /trunk/Ohana/src/opihi/pantasks/Makefile	(revision 4686)
@@ -14,4 +14,5 @@
 DESTINC =       $(LINC)
 DESTMAN =       $(LMAN)
+DESTHLP =       $(LHLP)/sched
 #  
 INCS    =       -I$(INC) -I$(LINC) -I$(XINC)
@@ -20,5 +21,5 @@
 LIBS2   =       -lbasiccmd -ldatacmd -lastrocmd -lshell -ldata 
 LIBS    =       $(LIBS2) $(LIBS1) 
-CFLAGS  =       $(INCS)
+CFLAGS  =       $(INCS) -DHELPDIR_DEFAULT=$(DESTHLP)
 CCFLAGS =       $(LIBS) 
 
@@ -74,5 +75,7 @@
 $(BIN)/scheduler.$(ARCH) : $(funcs) $(cmds) $(libs)
 
-install: $(DESTBIN)/scheduler
+install: $(DESTBIN)/scheduler help
+
+help: cmd.basic.help cmd.data.help cmd.astro.help sched.help
 
 # utilities #################################################
@@ -103,4 +106,10 @@
 	rm -f $@
 	cp $^ $@
+
+%.help:
+	@if [ ! -d $(DESTHLP) ]; then mkdir -p $(DESTHLP); fi
+	rm -f $(HOME)/$*/help/*~
+	rm -f $(HOME)/$*/help/#*
+	cp $(HOME)/$*/help/* $(DESTHLP)/
 
 clean:
Index: /trunk/Ohana/src/opihi/pantasks/scheduler.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/scheduler.c	(revision 4685)
+++ /trunk/Ohana/src/opihi/pantasks/scheduler.c	(revision 4686)
@@ -55,4 +55,9 @@
   set_str_variable ("PROMPT", opihi_prompt);
   set_str_variable ("RCFILE", opihi_rcfile);
+# define xstr(s) str(s)
+# define str(s) #s
+# ifdef HELPDIR_DEFAULT
+  set_str_variable ("HELPDIR", xstr(HELPDIR_DEFAULT));
+# endif
 
   /* here we open the history file for append.  it this fails, we
