bug 2148
[scilab.git] / scilab / modules / helptools / macros / help.sci
1 function help(key)
2         
3         //for compatibility with toolboxes making use of old cat files
4         if (fileinfo('SCI/modules/helptools/help') <> []) then
5                 global %browsehelp
6   
7     nwniarg=find(sciargs()=="-nwni");
8     texmacsarg=find(sciargs()=="--texmacs");
9     noguiarg=find(sciargs()=="-nogui");
10     
11     if (%browsehelp<>[])&(nwniarg == [])&(texmacsarg == [])&(noguiarg == []) then
12     
13                  change_old_man()
14                  INDEX=make_help_index()
15                 
16                  if argn(2)==0 then
17                          browsehelp(INDEX,"index");
18                          return
19                  end
20                 
21                  key=stripblanks(key)
22                 
23                  if or(part(key,1)==['(',')','[',']','{','}','%','''','""',':','*','/', ...
24                          '\','.','<','>','&','^','|','~','+','-']) then
25                          key="symbols";
26                  end
27                 
28                  path=gethelpfile(key)
29                 
30                  if path<>[] then
31                          browsehelp(path,key)
32                  else
33                          apropos(key)
34                  end
35                 else
36                   if (%browsehelp == []) then 
37        warning('%browsehelp not correctly defined. help browser disabled. ');
38        return;
39       end
40    
41       errmsg='help browser disabled in this mode : ';
42       if ( nwniarg <> []) then
43        errmsg=errmsg+'-nwni';
44        warning(errmsg);
45        return;
46       end
47       if ( texmacsarg <> []) then
48        errmsg=errmsg+ '--texmacs';
49        warning(errmsg);
50        return;
51       end
52       if ( noguiarg <> [] ) then
53        errmsg=errmsg+ '-nogui';
54        warning(errmsg);
55        return;
56       end
57                 end
58         else
59                 warning('Help not installed');
60         end
61         
62 endfunction
63
64
65
66
67
68
69
70
71