import shlex


def normalize_args(cmd_line_args):
    """Normalize input command.
      Whether expressed as single line of text or array, return array of arguments
      (less first arg, i.e. the executable invoking jcl)
      """
    if not cmd_line_args:
        return []
    if isinstance(cmd_line_args, list):
        args = cmd_line_args
    elif isinstance(cmd_line_args, tuple):
        args = list(cmd_line_args)
    elif isinstance(cmd_line_args, str):
        args = shlex.split(cmd_line_args)
    else:
        raise ValueError('Bad datatype "%s"; must be string, list or tuple' % type(cmd_line_args))
    return args