some bug fix
add a simple getopt utility