<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -10,49 +10,67 @@ Example:
       map &quot;-L&quot; =&gt; :list                                               # [2]
                                                                     
       desc &quot;install APP_NAME&quot;, &quot;install one of the available apps&quot;    # [3]
-      method_options :force =&gt; :boolean                               # [4]
-      def install(name, opts)
-        ... code ...
-        if opts[:force]
+      method_options :force =&gt; :boolean, :alias =&gt; :optional          # [4]
+      def install(name)
+        user_alias = options[:alias]
+        if options.force?
           # do something
         end
+        # ... other code ...
       end
       
       desc &quot;list [SEARCH]&quot;, &quot;list all of the available apps, limited by SEARCH&quot;
       def list(search = &quot;&quot;)
         # list everything
       end
-      
     end
     
-    MyApp.start
-    
-Thor automatically maps commands as follows:
+Thor automatically maps commands as such:
 
-    app install name --force
+    app install myname --force
     
 That gets converted to:
 
-    MyApp.new.install(&quot;name&quot;, :force =&gt; true)
+    MyApp.new.install(&quot;myname&quot;)
+    # with {'force' =&gt; true} as options hash
 
 1.  Inherit from Thor to turn a class into an option mapper
 2.  Map additional non-valid identifiers to specific methods. In this case,
     convert -L to :list
 3.  Describe the method immediately below. The first parameter is the usage information,
     and the second parameter is the description.
-4.  Provide any additional options. These will be marshaled from -- and - params.
-    In this case, a --force and a -f option is added.
+4.  Provide any additional options. These will be marshaled from `--` and `-` params.
+    In this case, a `--force` and a `-f` option is added.
     
 Types for `method_options`
 --------------------------
 
 &lt;dl&gt;
   &lt;dt&gt;&lt;code&gt;:boolean&lt;/code&gt;&lt;/dt&gt;
-  &lt;dd&gt;true if the option is passed&lt;/dd&gt;
+    &lt;dd&gt;true if the option is passed&lt;/dd&gt;
+  &lt;dt&gt;&lt;code&gt;true&lt;/code&gt;&lt;/dt&gt;
+    &lt;dd&gt;same as &lt;code&gt;:boolean&lt;/code&gt;&lt;/dd&gt;
   &lt;dt&gt;&lt;code&gt;:required&lt;/code&gt;&lt;/dt&gt;
-  &lt;dd&gt;the value for this option MUST be provided&lt;/dd&gt;
+    &lt;dd&gt;the value for this option MUST be provided&lt;/dd&gt;
   &lt;dt&gt;&lt;code&gt;:optional&lt;/code&gt;&lt;/dt&gt;
-  &lt;dd&gt;the value for this option MAY be provided&lt;/dd&gt;
-  &lt;dt&gt;a String&lt;/dt&gt;
-  &lt;dd&gt;same as &lt;code&gt;:optional&lt;/code&gt;; fall back to the given string as default value&lt;/dd&gt;
-&lt;/dl&gt;
\ No newline at end of file
+    &lt;dd&gt;the value for this option MAY be provided&lt;/dd&gt;
+  &lt;dt&gt;&lt;code&gt;:numeric&lt;/code&gt;&lt;/dt&gt;
+    &lt;dd&gt;the value MAY be provided, but MUST be in numeric form&lt;/dd&gt;
+  &lt;dt&gt;a String or Numeric&lt;/dt&gt;
+    &lt;dd&gt;same as &lt;code&gt;:optional&lt;/code&gt;, but fall back to the given object as default value&lt;/dd&gt;
+&lt;/dl&gt;
+
+In case of unsatisfied requirements, `Thor::Options::Error` is raised.
+
+Examples of option parsing:
+
+    # let's say this is how we defined options for a method:
+    method_options(:force =&gt; :boolean, :retries =&gt; :numeric)
+    
+    # here is how the following command-line invocations would be parsed:
+    
+    command -f --retries 5    # =&gt; {'force' =&gt; true, 'retries' =&gt; 5}
+    command --force -r=5      # =&gt; {'force' =&gt; true, 'retries' =&gt; 5}
+    command -fr 5             # =&gt; {'force' =&gt; true, 'retries' =&gt; 5}
+    command --retries=5       # =&gt; {'retries' =&gt; 5}
+    command -r5               # =&gt; {'retries' =&gt; 5}
\ No newline at end of file</diff>
      <filename>README.markdown</filename>
    </modified>
    <modified>
      <diff>@@ -165,7 +165,7 @@ class Thor
         when :required
           opt + &quot;=&quot; + opt.gsub(/\-/, &quot;&quot;).upcase
         else
-          sample = @defaults[undasherize opt]
+          sample = @defaults[undasherize(opt)]
           sample ||= case type
             when :optional then opt.gsub(/\-/, &quot;&quot;).upcase
             when :numeric  then &quot;N&quot;
@@ -228,7 +228,7 @@ class Thor
     
     def check_required!(hash)
       for name, type in @switches
-        if type == :required and !hash[undasherize name]
+        if type == :required and !hash[undasherize(name)]
           raise Error, &quot;no value provided for required argument '#{name}'&quot;
         end
       end</diff>
      <filename>lib/thor/options.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,9 +3,9 @@
 class Amazing &lt; Thor
   desc &quot;describe NAME&quot;, &quot;say that someone is amazing&quot;
   method_options :forcefully =&gt; :boolean
-  def describe(name, opts = {})
+  def describe(name)
     ret = &quot;#{name} is amazing&quot;
-    puts opts[&quot;forcefully&quot;] ? ret.upcase : ret
+    puts options.forcefully?? ret.upcase : ret
   end
   
   desc &quot;hello&quot;, &quot;say hello&quot;</diff>
      <filename>task.thor</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4e4be8c2d31f62076b3ad1a6a769400f94215998</id>
    </parent>
  </parents>
  <author>
    <name>Mislav Marohni&#263;</name>
    <email>mislav.marohnic@gmail.com</email>
  </author>
  <url>http://github.com/wycats/thor/commit/a699ed71fd858b248d23f7341f3f292609063463</url>
  <id>a699ed71fd858b248d23f7341f3f292609063463</id>
  <committed-date>2008-08-27T07:28:58-07:00</committed-date>
  <authored-date>2008-08-26T17:10:57-07:00</authored-date>
  <message>update (incorrect) README and task.thor sample file</message>
  <tree>fa65dc54d2137fa2ea5b19cd6157045f642587eb</tree>
  <committer>
    <name>Mislav Marohni&#263;</name>
    <email>mislav.marohnic@gmail.com</email>
  </committer>
</commit>
