Jar help files names management
[scilab.git] / scilab / modules / helptools / macros / help.sci
1
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2008 - INRIA
4 //
5 // This file must be used under the terms of the CeCILL.
6 // This source file is licensed as described in the file COPYING, which
7 // you should have received as part of this distribution.  The terms
8 // are also available at
9 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10
11 function help(key)
12         
13         //for compatibility with toolboxes making use of old cat files
14         
15         if (fileinfo('SCI/modules/helptools/help') <> []) then
16                 
17                 global %browsehelp
18                 nwniarg=find(sciargs()=="-nwni");
19                 texmacsarg=find(sciargs()=="--texmacs");
20                 noguiarg=find(sciargs()=="-nogui");
21                 
22                 if (%browsehelp<>[])&(nwniarg == [])&(texmacsarg == [])&(noguiarg == []) then
23                         
24                         change_old_man()
25                         INDEX=make_help_index()
26                         
27                         if argn(2)==0 then
28                                 //global %helps
29                                 //helpbrowser(%helps(:,1));
30                                 browsehelp(INDEX,"index");
31                                 return
32                         end
33                         
34                         key=stripblanks(key)
35                         
36                         if or(part(key,1)==['(',')','[',']','{','}','%','''','""',':','*','/', ...
37                                 '\','.','<','>','&','^','|','~','+','-']) then
38                                 key="symbols";
39                         end
40                         
41                         path=gethelpfile(key)
42                         
43                         if path<>[] then
44                                 //global %helps
45                                 //helpbrowser(%helps(:,1), key);
46                                 browsehelp(path,key)
47                         else
48                                 apropos(key)
49                         end
50                         
51                 else
52                         if (%browsehelp == []) then
53                                 warning('%browsehelp not correctly defined. help browser disabled. ');
54                                 return;
55                         end
56                         
57                         errmsg='help browser disabled in this mode : ';
58                         
59                         if ( nwniarg <> []) then
60                                 errmsg=errmsg+'-nwni';
61                                 warning(errmsg);
62                                 return;
63                         end
64                         
65                         if ( texmacsarg <> []) then
66                                 errmsg=errmsg+ '--texmacs';
67                                 warning(errmsg);
68                                 return;
69                         end
70                         
71                         if ( noguiarg <> [] ) then
72                                 errmsg=errmsg+ '-nogui';
73                                 warning(errmsg);
74                                 return;
75                         end
76                 end
77         else
78                 warning('Help not installed');
79         end
80         
81 endfunction
82
83
84
85
86
87
88
89
90