def main():
    global debug
    parser = cli_parser.build_argparse()
    arguments = parser.parse_args()

    if arguments.dbg:
        debug = True

    if arguments.P:
        if arguments.password:
            print "Error: You cannot use -P and --password together!"
            sys.exit(1)

        arguments.password = getpass.getpass("Enter password: ")

    phases = []
    if arguments.command == "list":
        if arguments.completed:
            phases.append(UWS.models.JobPhases.COMPLETED)
        if arguments.pending:
            phases.append(UWS.models.JobPhases.PENDING)
        if arguments.queued:
            phases.append(UWS.models.JobPhases.QUEUED)
        if arguments.executing:
            phases.append(UWS.models.JobPhases.EXECUTING)
        if arguments.error:
            phases.append(UWS.models.JobPhases.ERROR)
        if arguments.aborted:
            phases.append(UWS.models.JobPhases.ABORTED)
        if arguments.unknown:
            phases.append(UWS.models.JobPhases.UNKNOWN)
        if arguments.held:
            phases.append(UWS.models.JobPhases.HELD)
        if arguments.suspended:
            phases.append(UWS.models.JobPhases.SUSPENDED)
        if arguments.archived:
            phases.append(UWS.models.JobPhases.ARCHIVED)

        after = None
        if arguments.after:
            after = _check_joblist_after(arguments.after)

        last = None
        if arguments.last:
            last = _check_joblist_last(arguments.last)

        list_jobs(arguments.host, arguments.user, arguments.password, phases, after, last)

    if arguments.command == "job":
        if arguments.job_command == "show":
            wait, phase = _check_job_wait_args(arguments)
            show_job(arguments.host, arguments.user, arguments.password, arguments.id, wait, phase)
        elif arguments.job_command == "phase":
            show_phase(arguments.host, arguments.user, arguments.password, arguments.id)
        elif arguments.job_command == "new":
            # parse the job parameters and store in argument list
            job_parameters = _check_job_parameter_args(arguments.job_parameters)

            new_job(arguments.host, arguments.user, arguments.password, job_parameters, arguments.run)
        elif arguments.job_command == "set":
            # parse the job parameters and store in argument list
            job_parameters = _check_job_parameter_args(arguments.job_parameters)

            set_parameters_job(arguments.host, arguments.user, arguments.password, arguments.id, job_parameters)
        elif arguments.job_command == "run":
            run_job(arguments.host, arguments.user, arguments.password, arguments.id)
        elif arguments.job_command == "abort":
            abort_job(arguments.host, arguments.user, arguments.password, arguments.id)
        elif arguments.job_command == "delete":
            delete_job(arguments.host, arguments.user, arguments.password, arguments.id)
        elif arguments.job_command == "results":
            results_job(arguments.host, arguments.user, arguments.password, arguments.id, arguments.result_id, arguments.file_base)
        else:
            print (arguments.job_command) % "Error: Unknown command %s\n"
dataset/ETHPy150Open aipescience/uws-client/uws/cli/main.py/main/swapped operands of `%`