allow downcased arch names

git-svn-id: file:///home/svn/framework3/trunk@12254 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Joshua Drake 2011-04-06 19:06:28 +00:00
parent 3c7bf5bf45
commit b10963bd69
1 changed files with 14 additions and 7 deletions

View File

@ -35,13 +35,20 @@ $args = Rex::Parser::Arguments.new(
$args.parse(ARGV) { |opt, idx, val| $args.parse(ARGV) { |opt, idx, val|
case opt case opt
when "-a" when "-a"
usage unless @Arch.include?(val) found = nil
String.class_eval("@@cpu = Metasm::#{val}.new") @Arch.each { |a|
when "-h" if val.downcase == a.downcase
usage String.class_eval("@@cpu = Metasm::#{a}.new")
else found = true
usage end
}
usage if not found
when "-h"
usage
else
usage
end end
} }