page_screen_output (false);

octave_version = OCTAVE_VERSION ();

printf ("octave version: %s\n", octave_version);
pause ();

[local_list, global_list] = pkg ("list");
if (! isempty (idx = ...
               find (strcmp ("optim",
                             {structcat(1, local_list{:}).name}),
                     1)))
  idir = local_list{idx}.dir;
elseif (! isempty (idx = ...
                   find (strcmp ("optim",
                                 {structcat(1, global_list{:}).name}),
                         1)))
  idir = global_list{idx}.dir;
else
  error ("no installed optim package found");
endif
infopath = fullfile (idir, "doc/", "optim.info");
## allow for .gz
if (! exist (infopath, "file"))
  infopath = strcat (infopath, ".gz");
endif

printf ("info file: %s\n", infopath);
pause ();

INFO = info_program ();
printf ("info program: %s\n", INFO);
pause ();

[status, output] = system (sprintf ("%s --version", INFO));
printf ("info program version:\n%s\n", output);
pause ();

status = system (sprintf ("%s %s", INFO, infopath));
disp ("done");
