title: How do I register a Thor::Group as a subcommand with arguments
body: <p>This question started out <a href="https://stackoverflow.com/questions/9339677/how-do-i-create-thorgroup-generators-as-args-of-my-command">here</a>. But changed significantly as I learned more about Thor.</p>
  
  <p>I'm trying to make a Thor::Group subcommand that takes an argument. Oddly, it works if there are no arguments. </p>
  
  <p>Can I use a Thor::Group as a sub-command?</p>
  
  <p>This works when I type:  <code>foo counter</code>  </p>
  
  <p><em>foo/bin/foo</em></p>
  
  <pre><code>module Foo
    class CLI &lt; Thor
      register(Counter, 'counter', 'counter', 'Count up from the 1.')
    end
  
    class Counter &lt; Thor::Group
      desc "Prints 1 2"
  
      def one
        puts 1
      end
  
      def two
        puts 2
      end
  
    end
  
  end
  
  Foo::CLI.start
  </code></pre>
  
  <p>But this doesn't work when I type:  <code>foo counter 5</code>  </p>
  
  <pre><code>module Foo
    class CLI &lt; Thor
      register(Counter, 'counter', 'counter &lt;number&gt;', 'Count up from the input.')
    end
  
    class Counter &lt; Thor::Group
      argument :number, :type =&gt; :numeric, :desc =&gt; "The number to start counting"
      desc "Prints 2 numbers based on input"
  
      def one
        puts number + 0
      end
  
      def two
        puts number + 1
      end
  
    end
  
  
  end
  
  Foo::CLI.start
  </code></pre>
  
  <p>It replies: <code>counter was called incorrectly. Call as foo counter number</code></p>