migrated optparse to argparse