/[mldonkey]/mldonkey/src/daemon/driver/driverControlers.ml
ViewVC logotype

Diff of /mldonkey/src/daemon/driver/driverControlers.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.29 by spiralvoice, Tue Apr 26 11:02:21 2005 UTC revision 1.30 by spiralvoice, Wed Jun 1 22:19:57 2005 UTC
# Line 98  let eval auth cmd o = Line 98  let eval auth cmd o =
98      [] -> ()      [] -> ()
99    | ["longhelp"] | ["??"] ->    | ["longhelp"] | ["??"] ->
100        let module M = CommonMessages in        let module M = CommonMessages in
101        Buffer.add_string  buf M.available_commands_are;        if o.conn_output = HTML then begin
102        if use_html_mods o then begin            Buffer.add_string buf "\\<div class=\\\"cs\\\"\\>";
103            let counter = ref 0 in            html_mods_table_header buf "helpTable" "results" [];
104              Buffer.add_string buf "\\<tr\\>";
105              html_mods_td buf [
106                ("", "srh", M.available_commands_are);
107                ("", "srh", "");
108                ("", "srh", ""); ];
109              Buffer.add_string buf "\\</tr\\>";
110              html_mods_cntr_init ();
111            List.iter (fun (cmd, _, _, help) ->            List.iter (fun (cmd, _, _, help) ->
               incr counter;  
112                let ncmd = ref cmd in                let ncmd = ref cmd in
113                let nhelp = ref help in                let nhelp = ref help in
114                Printf.bprintf buf "\\<tr class=\\\"%s\\\"\\>"(if (!counter mod 2 == 0) then "dl-1" else "dl-2";);                Printf.bprintf buf "\\<tr class=\\\"dl-%d\\\"\\>" (html_mods_cntr ());
115                html_mods_td buf [ ("", "sr", !ncmd); ("", "srw", Str.global_replace (Str.regexp "\n") "\\<br\\>" !nhelp) ];                html_mods_td buf [
116                    ("", "sr", "\\<a href=\\\"submit?q=" ^ !ncmd ^
117                      "\\\"\\>" ^ !ncmd ^ "\\</a\\>");
118                    ("", "srw", Str.global_replace (Str.regexp "\n") "\\<br\\>" !nhelp);
119                    ("", "sr", "\\<a href=\\\"http://mldonkey.berlios.de/modules.php?name=Wiki&pagename=" ^ !ncmd ^
120                      "\\\"\\>wiki\\</a\\>"); ];
121                Printf.bprintf buf "\\</tr\\>\n";                Printf.bprintf buf "\\</tr\\>\n";
122            )            )
123            (List.sort (fun (c1,_, _,_) (c2,_, _,_) -> compare c1 c2)            (List.sort (fun (c1,_, _,_) (c2,_, _,_) -> compare c1 c2)
124              !CommonNetwork.network_commands);              !CommonNetwork.network_commands);
125            Printf.bprintf buf "\\</table\\>\\</div\\>"            Printf.bprintf buf "\\</table\\>\\</div\\>";
126              html_mods_table_header buf "helpTable" "results" [];
127              Printf.bprintf buf "\\<tr class=\\\"dl-1\\\"\\>";
128              html_mods_td buf [
129                ("", "sr", "< > : required parameter");
130                ("", "sr", "[< >] : optionnal parameter");
131                ("", "sr", "< 1 | 2 > : alternative parameter"); ];
132              Printf.bprintf buf "\\</table\\>\\</div\\>\\</div\\>"
133          end else                  end else        
134          begin          begin
135              Buffer.add_string  buf M.available_commands_are;
136            let list = Hashtbl2.to_list2 commands_by_kind in            let list = Hashtbl2.to_list2 commands_by_kind in
137            let list = List.sort (fun (s1,_) (s2,_) -> compare s1 s2) list in            let list = List.sort (fun (s1,_) (s2,_) -> compare s1 s2) list in
138            List.iter (fun (s,list) ->            List.iter (fun (s,list) ->
# Line 127  let eval auth cmd o = Line 146  let eval auth cmd o =
146                    
147      | ["help"] | ["?"] ->      | ["help"] | ["?"] ->
148            let module M = CommonMessages in            let module M = CommonMessages in
149            Buffer.add_string  buf             if o.conn_output = HTML then
150              "Main commands are:               begin
151                   Buffer.add_string buf "\\<div class=\\\"cs\\\"\\>";
152                   html_mods_table_header buf "helpTable" "results" [];
153                   Buffer.add_string buf "\\<tr\\>";
154                   html_mods_td buf [
155                     ("", "srh", M.main_commands_are);
156                     ("", "srh", ""); ];
157                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-1\\\"\\>";
158                   html_mods_td buf [
159                     ("", "sr", "$bServers:$n");
160                     ("", "sr", ""); ];
161                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
162                   html_mods_td buf [
163                     ("", "sr", "$r\\<a href=\\\"submit?q=vm\\\"\\>" ^
164                       "vm\\</a\\>$n");
165                     ("", "sr", "list connected servers"); ];
166                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
167                   html_mods_td buf [
168                     ("", "sr", "$r\\<a href=\\\"submit?q=vma\\\"\\>" ^
169                       "vma\\</a\\>$n");
170                     ("", "sr", "list all servers"); ];
171                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
172                   html_mods_td buf [
173                     ("", "sr", "$rc/x <num>$n");
174                     ("", "sr", "connect/disconnect from a server"); ];
175                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-1\\\"\\>";
176                   html_mods_td buf [
177                     ("", "sr", "$bDownloads:$n");
178                     ("", "sr", ""); ];
179                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
180                   html_mods_td buf [
181                     ("", "sr", "$r\\<a href=\\\"submit?q=vd\\\"\\>" ^
182                       "vd\\</a\\>$n");
183                     ("", "sr", "view current downloads"); ];
184                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
185                   html_mods_td buf [
186                     ("", "sr", "$rcancel/pause/resume <num>$n");
187                     ("", "sr", "cancel/pause/resume download <num>"); ];
188                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-1\\\"\\>";
189                   html_mods_td buf [
190                     ("", "sr", "$bSearches:$n");
191                     ("", "sr", ""); ];
192                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
193                   html_mods_td buf [
194                     ("", "sr", "$rs  <keywords>$n");
195                     ("", "sr", "start a search for keywords <keywords> on the network"); ];
196                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
197                   html_mods_td buf [
198                     ("", "sr", "$r\\<a href=\\\"submit?q=vr\\\"\\>" ^
199                       "vr\\</a\\>$n");
200                     ("", "sr", "view results of the last search"); ];
201                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
202                   html_mods_td buf [
203                     ("", "sr", "$rd <num>$n");
204                     ("", "sr", "download result number <num>"); ];
205                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
206                   html_mods_td buf [
207                     ("", "sr", "$r\\<a href=\\\"submit?q=vs\\\"\\>" ^
208                       "vs\\</a\\>$n");
209                     ("", "sr", "view previous searches"); ];
210                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
211                   html_mods_td buf [
212                     ("", "sr", "$rvr <num>$n");
213                     ("", "sr", "view results of search <num>"); ];
214                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-1\\\"\\>";
215                   html_mods_td buf [
216                     ("", "sr", "$bGeneral:$n");
217                     ("", "sr", ""); ];
218                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
219                   html_mods_td buf [
220                     ("", "sr", "$r\\<a href=\\\"submit?q=save\\\"\\>" ^
221                       "save\\</a\\>$n");
222                     ("", "sr", "save configuration files"); ];
223                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
224                   html_mods_td buf [
225                     ("", "sr", "$rkill$n");
226                     ("", "sr", "kill mldonkey properly"); ];
227                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-2\\\"\\>";
228                   html_mods_td buf [
229                     ("", "sr", "$rq$n");
230                     ("", "sr", "quit this interface"); ];
231                   Buffer.add_string buf "\\</tr\\>\\</table\\>\\</div\\>\n";
232                   html_mods_table_header buf "helpTable" "results" [];
233                   Buffer.add_string buf "\\<tr class=\\\"dl-1\\\"\\>";
234                   html_mods_td buf [
235                     ("", "sr", "Use '$r\\<a href=\\\"submit?q=longhelp\\\"\\>" ^
236                       "longhelp\\</a\\>$n' or '$r\\<a href=\\\"submit?q=longhelp\\\"\\>" ^
237                       "??\\</a\\>$n' for all commands."); ];
238                   Buffer.add_string buf "\\</tr\\>\\<tr class=\\\"dl-1\\\"\\>";
239                   html_mods_td buf [
240                     ("", "sr", "Use '$rhelp command$n' or '$r? command$n' for help on a command."); ];
241                   Buffer.add_string buf "\\</tr\\>\\</table\\>\\</div\\>\\</div\\>\n"
242                end
243              else
244                  Buffer.add_string  buf
245                  "Main commands are:
246    
247  $bServers:$n  $bServers:$n
248            $rvm$n : list connected servers            $rvm$n : list connected servers
# Line 151  $bGeneral:$n Line 265  $bGeneral:$n
265            $rkill$n : kill mldonkey properly            $rkill$n : kill mldonkey properly
266            $rq$n : quit this interface            $rq$n : quit this interface
267    
268  Use '$r";  Use '$rlonghelp$n' or '$r??$n' for all commands.
            if o.conn_output = HTML then  
              Buffer.add_string buf "\\<a href=\\\"submit?q=longhelp\\\"\\>";  
            Buffer.add_string buf "longhelp";  
            if o.conn_output = HTML then  
              Buffer.add_string buf "\\</a\\>";  
            Buffer.add_string buf "$n' or '$r";  
            if o.conn_output = HTML then  
              Buffer.add_string buf "\\<a href=\\\"submit?q=longhelp\\\"\\>";  
            Buffer.add_string buf "??";  
            if o.conn_output = HTML then  
              Buffer.add_string buf "\\</a\\>";  
            Buffer.add_string buf "$n' for all commands.  
269  Use '$rhelp command$n' or '$r? command$n' for help on a command.  Use '$rhelp command$n' or '$r? command$n' for help on a command.
270              ";              ";
271      | "?" :: args | "help" :: args ->      | "?" :: args | "help" :: args ->

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26