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|
case opt
when "-a"
usage unless @Arch.include?(val)
String.class_eval("@@cpu = Metasm::#{val}.new")
when "-h"
usage
else
usage
when "-a"
found = nil
@Arch.each { |a|
if val.downcase == a.downcase
String.class_eval("@@cpu = Metasm::#{a}.new")
found = true
end
}
usage if not found
when "-h"
usage
else
usage
end
}