Improve OSX/Ruby version : use getopts