def METHOD_NAME(args):
    #  Create a test jobspec
    if not args.command:
        args.command = ["true"]
    jobspec = JobspecV1.from_command(args.command)
    #  Set any requested shell options
    if args.setopt is not None:
        for keyval in args.setopt:
            # Split into key, val with a default for 1 if no val given:
            key, val = (keyval.split("=", 1) + [1])[:2]
            try:
                val = json.loads(val)
            except (json.JSONDecodeError, TypeError):
                pass
            jobspec.setattr_shell_option(key, val)
    #  Set any requested Jobspec attributes
    if args.setattr is not None:
        for keyval in args.setattr:
            tmp = keyval.split("=", 1)
            if len(tmp) != 2:
                raise ValueError("--setattr: Missing value for attr " + keyval)
            key = tmp[0]
            try:
                val = json.loads(tmp[1])
            except (json.JSONDecodeError, TypeError):
                val = tmp[1]
            jobspec.setattr(key, val)
    if not args.exec:
        jobspec.setattr("system.exec.test.run_duration", args.runtime)
    return jobspec