wycats/thor — Issue #203: Usage error when called with array argument
Author: bjoernalbers
Created: 2011-12-01 17:12:44+00:00
State: open

I'm trying to define a class argument with an array type, which [should work](http://rubydoc.info/github/wycats/thor/master/Thor/Base/ClassMethods#argument-instance_method):

```ruby
class Foo < Thor

argument :baz, :desc => "an array argument", :type => :array

desc "bar", "...just a task"
def bar
puts self.baz.inspect
end
end
```

However, running the task with actual array options raises an usage error:

```
$ thor -T
foo
---
thor foo:bar one two three # ...just a task
$ thor foo:bar one two three
"bar" was called incorrectly. Call as "thor foo:bar one two three".
```

When I run it with only one argument, then it works:

```
$ thor foo:bar "one two three"
["one two three"]
```
I've tested on Ruby 1.8.7 and 1.9.2 with thor 0.14.6.