def _prep_sge_resource(resource):
    """Prepare SGE resource specifications from the command line handling special cases.
    """
    resource = resource.strip()
    k, v = resource.split("=")
    if k in set(["ar"]):
        return "#$ -%s %s" % (k, v)
    else:
        return "#$ -l %s" % resource