/usr/share/mozart/doc/demo/node39.html is in mozart-doc 1.4.0-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Command-Line Application: Main.oz</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node38.html#code.dict-client.tkdictionary"><< Prev</A></TD><TD><A href="dict-client.html">- Up -</A></TD></TR></TABLE><DIV class="unnumbered" id="code.dict-client.main"><H3><A name="code.dict-client.main">Command-Line Application: <CODE>Main.oz</CODE></A></H3><DIV class="apropos"><P class="margin"><A href="DictClient/Main.oz">Source File</A></P><P> </P><BLOCKQUOTE><PRE>%%<SPAN class="comment"> <BR></SPAN>%% <SPAN class="comment">The Main Application<BR></SPAN>%%<SPAN class="comment"> <BR></SPAN>%% <SPAN class="comment">Parse the command line, initialize the connection,<BR></SPAN>%% <SPAN class="comment">wait for the graphical front-end window to be closed<BR></SPAN>%% <SPAN class="comment">and exit.<BR></SPAN>%%<SPAN class="comment"> <BR></SPAN> <BR><SPAN class="keyword">functor</SPAN> <BR><SPAN class="keyword">import</SPAN> <BR> Application(getCmdArgs exit)<BR> System(printError)<BR> Property(get)<BR> TkDictionary(<SPAN class="string">'class'</SPAN>)<BR> GtkDictionary(<SPAN class="string">'class'</SPAN>)<BR><SPAN class="keyword">prepare</SPAN> <BR> ArgSpec = record(help(rightmost char: [<SPAN class="string">&?</SPAN> <SPAN class="string">&h</SPAN>] default: <SPAN class="keyword">false</SPAN>)<BR> server(single char: <SPAN class="string">&s</SPAN> type: string default: <SPAN class="string">'dict.org'</SPAN>)<BR> host(alias: server)<BR> port(single char: <SPAN class="string">&p</SPAN> type: int default: 2628)<BR> mode(single type: atom(tk gtk) default: tk))<BR> <BR> UsageString =<BR> <SPAN class="string">'--help, -?, -h Display this message.\n'</SPAN><SPAN class="keyword">#</SPAN> <BR> <SPAN class="string">'--server=HOST, --host=HOST, -s HOST\n'</SPAN><SPAN class="keyword">#</SPAN> <BR> <SPAN class="string">'--port=PORT, -p PORT\n'</SPAN><SPAN class="keyword">#</SPAN> <BR> <SPAN class="string">' Initially try to connect to HOST on PORT.\n'</SPAN><SPAN class="keyword">#</SPAN> <BR> <SPAN class="string">'--mode=tk, --mode=gtk\n'</SPAN><SPAN class="keyword">#</SPAN> <BR> <SPAN class="string">' Widget toolkit to use (default: tk).\n'</SPAN> <BR><SPAN class="keyword">define</SPAN> <BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">Usage</SPAN> VS N}<BR> {System<SPAN class="keyword">.</SPAN>printError<BR> VS<SPAN class="keyword">#</SPAN><SPAN class="string">'Usage: '</SPAN><SPAN class="keyword">#</SPAN>{Property<SPAN class="keyword">.</SPAN>get <SPAN class="string">'application.url'</SPAN>}<SPAN class="keyword">#</SPAN><SPAN class="string">' <option> ...\n'</SPAN><SPAN class="keyword">#</SPAN> <BR> UsageString}<BR> {Application<SPAN class="keyword">.</SPAN>exit N}<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> <SPAN class="keyword">try</SPAN> Args <SPAN class="keyword">in</SPAN> <BR> Args = {Application<SPAN class="keyword">.</SPAN>getCmdArgs ArgSpec}<BR> <SPAN class="keyword">if</SPAN> Args<SPAN class="keyword">.</SPAN>help <SPAN class="keyword">then</SPAN> <BR> {Usage <SPAN class="string">""</SPAN> 0}<BR> <SPAN class="keyword">end</SPAN> <BR> {Wait {New <SPAN class="keyword">case</SPAN> Args<SPAN class="keyword">.</SPAN>mode <SPAN class="keyword">of</SPAN> tk <SPAN class="keyword">then</SPAN> TkDictionary<SPAN class="keyword">.</SPAN><SPAN class="string">'class'</SPAN> <BR> <SPAN class="keyword">[]</SPAN> gtk <SPAN class="keyword">then</SPAN> GtkDictionary<SPAN class="keyword">.</SPAN><SPAN class="string">'class'</SPAN> <BR> <SPAN class="keyword">end</SPAN> init(Args<SPAN class="keyword">.</SPAN>server Args<SPAN class="keyword">.</SPAN>port)}<SPAN class="keyword">.</SPAN>closed}<BR> {Application<SPAN class="keyword">.</SPAN>exit 0}<BR> <SPAN class="keyword">catch</SPAN> error(ap(usage VS) <SPAN class="keyword">...</SPAN>) <SPAN class="keyword">then</SPAN> <BR> {Usage <SPAN class="string">'Usage error: '</SPAN><SPAN class="keyword">#</SPAN>VS<SPAN class="keyword">#</SPAN><SPAN class="string">'\n'</SPAN> 2}<BR> <SPAN class="keyword">end</SPAN> <BR><SPAN class="keyword">end</SPAN> <BR></PRE></BLOCKQUOTE><P> </P></DIV></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node38.html#code.dict-client.tkdictionary"><< Prev</A></TD><TD><A href="dict-client.html">- Up -</A></TD></TR></TABLE><HR><ADDRESS><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|