When i use OptionParser, i want to limit the users input with a Enum, how to do that?
e.g. check following code,
"Specify engine used for translate, support bing|youdao for now.
") do |e|
engine = "bing"
engine = "youdao"
STDERR.puts "Supported options: -e bing|youado"
The user passed args with -e ARGS is a string, i have to raise a error to limit the user only can support -e youdao or -e bing, this really a case which enum be good at, right?
This is basically a question of user input working with enum, so, is it possible?