use getopt() to handle program arguments

Signed-off-by: Haley Teng <haley.teng@gmail.com>
implement usage() for '-h' argument

Signed-off-by: Haley Teng <haley.teng@gmail.com>