tmud-2.10.1/benchmark/
tmud-2.10.1/cmd/
tmud-2.10.1/cmd/objects/
tmud-2.10.1/cmd/tiny/
tmud-2.10.1/doc/classes/SQLite/
tmud-2.10.1/doc/classes/SQLite3/
tmud-2.10.1/doc/classes/TernaryTrie/
tmud-2.10.1/doc/files/cmd/objects/
tmud-2.10.1/doc/files/cmd/tiny/
tmud-2.10.1/doc/files/lib/
tmud-2.10.1/doc/files/lib/engine/
tmud-2.10.1/doc/files/lib/farts/
tmud-2.10.1/farts/
tmud-2.10.1/lib/
tmud-2.10.1/lib/core/
tmud-2.10.1/lib/engine/
tmud-2.10.1/lib/farts/
tmud-2.10.1/logs/
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>File: tmud.rb</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



  <div id="fileHeader">
    <h1>tmud.rb</h1>
    <table class="header-table">
    <tr class="top-aligned-row">
      <td><strong>Path:</strong></td>
      <td>tmud.rb
      </td>
    </tr>
    <tr class="top-aligned-row">
      <td><strong>Last Update:</strong></td>
      <td>Wed Mar 15 19:52:12 -0400 2006</td>
    </tr>
    </table>
  </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">
    <div id="diagram">
      <map id="map" name="map">
</map>
<img src="../dot/f_0.png" usemap="#map" border="0" alt="dot/f_0.png">
    </div>

    <div id="description">
      <table>
<tr><td valign="top">file:</td><td>tmud.rb

</td></tr>
<tr><td valign="top">author:</td><td>Jon A. Lambert

</td></tr>
<tr><td valign="top">version:</td><td>2.8.0

</td></tr>
<tr><td valign="top">date:</td><td>01/19/2006

</td></tr>
</table>
<p>
This source code copyright (C) 2005, 2006 by Jon A. Lambert All rights
reserved.
</p>
<p>
Released under the terms of the TeensyMUD Public License See LICENSE file
for additional information.
</p>

    </div>

    <div id="requires-list">
      <h3 class="section-bar">Required files</h3>

      <div class="name-list">
      optparse&nbsp;&nbsp;
      utility/utility&nbsp;&nbsp;
      utility/configuration&nbsp;&nbsp;
      engine/engine&nbsp;&nbsp;
      utility/version&nbsp;&nbsp;
      </div>
    </div>

   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000001">get_options</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000001" class="method-detail">
        <a name="M000001"></a>

        <div class="method-heading">
          <a href="#M000001" class="method-signature">
          <span class="method-name">get_options</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Processes command line arguments
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000001-source">
<pre>
<span class="ruby-comment cmt"># File tmud.rb, line 27</span>
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_options</span>
  <span class="ruby-comment cmt"># parse options</span>
  <span class="ruby-keyword kw">begin</span>
    <span class="ruby-comment cmt"># The myopts specified on the command line will be collected in *myopts*.</span>
    <span class="ruby-comment cmt"># We set default values here.</span>
    <span class="ruby-identifier">myopts</span> = {}

    <span class="ruby-identifier">opts</span> = <span class="ruby-constant">OptionParser</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">opts</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">banner</span> = <span class="ruby-constant">BANNER</span>
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;&quot;</span>
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">separator</span> <span class="ruby-node">&quot;Usage: ruby #{$0} [options]&quot;</span>
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">separator</span> <span class="ruby-value str">&quot;&quot;</span>
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;-p&quot;</span>, <span class="ruby-value str">&quot;--port PORT&quot;</span>, <span class="ruby-constant">Integer</span>,
        <span class="ruby-value str">&quot;Select the port the mud will run on&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">myopts</span>[<span class="ruby-value str">'server_port'</span>]<span class="ruby-operator">|</span>}
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;-d&quot;</span>, <span class="ruby-value str">&quot;--dbfile DBFILE&quot;</span>, <span class="ruby-constant">String</span>,
        <span class="ruby-value str">&quot;Select the name of the database file&quot;</span>,
        <span class="ruby-value str">&quot;  (default is 'db/world.yaml')&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">myopts</span>[<span class="ruby-value str">'dbfile'</span>]<span class="ruby-operator">|</span>}
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;-c&quot;</span>, <span class="ruby-value str">&quot;--config CONFIGFILE&quot;</span>, <span class="ruby-constant">String</span>,
        <span class="ruby-value str">&quot;Select the name of the configuration file&quot;</span>,
        <span class="ruby-value str">&quot;  (default is 'config.yaml')&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">myopts</span>[<span class="ruby-value str">'configfile'</span>]<span class="ruby-operator">|</span>}
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;-l&quot;</span>, <span class="ruby-value str">&quot;--logfile LOGFILE&quot;</span>, <span class="ruby-constant">String</span>,
        <span class="ruby-value str">&quot;Select the name of the log file&quot;</span>,
        <span class="ruby-value str">&quot;  (default is 'logs/server.log')&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">myopts</span>[<span class="ruby-value str">'logfile'</span>]<span class="ruby-operator">|</span>}
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;-h&quot;</span>, <span class="ruby-value str">&quot;--home LOCATIONID&quot;</span>, <span class="ruby-constant">Integer</span>,
        <span class="ruby-value str">&quot;Select the object id where new characters will start&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">myopts</span>[<span class="ruby-value str">'home'</span>]<span class="ruby-operator">|</span>}
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;-t&quot;</span>, <span class="ruby-value str">&quot;--[no-]trace&quot;</span>, <span class="ruby-value str">&quot;Trace execution&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">myopts</span>[<span class="ruby-value str">'trace'</span>]<span class="ruby-operator">|</span>}
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on</span>(<span class="ruby-value str">&quot;-v&quot;</span>, <span class="ruby-value str">&quot;--[no-]verbose&quot;</span>, <span class="ruby-value str">&quot;Run verbosely&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">myopts</span>[<span class="ruby-value str">'verbose'</span>]<span class="ruby-operator">|</span>}
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on_tail</span>(<span class="ruby-value str">&quot;-h&quot;</span>, <span class="ruby-value str">&quot;--help&quot;</span>, <span class="ruby-value str">&quot;Show this message&quot;</span>) <span class="ruby-keyword kw">do</span>
        <span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">help</span>
        <span class="ruby-identifier">exit</span>
      <span class="ruby-keyword kw">end</span>
      <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">on_tail</span>(<span class="ruby-value str">&quot;--version&quot;</span>, <span class="ruby-value str">&quot;Show version&quot;</span>) <span class="ruby-keyword kw">do</span>
        <span class="ruby-identifier">$stdout</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;TeensyMud #{Version}&quot;</span>
        <span class="ruby-identifier">exit</span>
      <span class="ruby-keyword kw">end</span>
    <span class="ruby-keyword kw">end</span>

    <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">parse!</span>(<span class="ruby-constant">ARGV</span>)

    <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">myopts</span>
  <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">OptionParser</span><span class="ruby-operator">::</span><span class="ruby-constant">ParseError</span>
    <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;ERROR - #{$!}&quot;</span>
    <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-value str">&quot;For help...&quot;</span>
    <span class="ruby-identifier">$stderr</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot; ruby #{$0} --help&quot;</span>
    <span class="ruby-identifier">exit</span>
  <span class="ruby-keyword kw">end</span>
<span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>