Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should check enum value on argument. #364

Open
Zapata opened this issue Sep 8, 2013 · 0 comments
Open

Should check enum value on argument. #364

Zapata opened this issue Sep 8, 2013 · 0 comments

Comments

@Zapata
Copy link

Zapata commented Sep 8, 2013

Enum should work on arguments also.

With this code:

require 'rubygems'
require 'thor'

class EnumArgument < Thor

  argument :fruit, :enum => %w{banana, apple}

  desc 'salad fruit', 'Only like fruit salad'
  def salad
    puts fruit
  end
end

EnumArgument.start

We expect to have an error when executing:

$ ruby enum_argument.rb salad tomato

It does not with thor-0.18.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant