<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_args(spectypes):
 """ Return arguments object formed by parsing the command line used to launch the program. """

    arg_parser = argparse.ArgumentParser()
    arg_parser.add_argument(
        "-c", "--constants",
        help="emit constants instead of spec dict",
        action="store_true"
    )
    arg_parser.add_argument(
        "spectype",
        help="specifies the spec type to be generated",
        choices=spectypes
    )
    return arg_parser.parse_args()