import json


def get_command_line(command, positional):
    """
    Gets the command line invocation for this submission by
    concatenating the command, and positional arguments
    @param command - command line from job spec
    @param positional - positional arguments
    @return: command strin with args, or None
    """

    parts = []
    if not command is None:
        parts.append(command)
    for posit in positional:
        # Escape any single quotes
        if not isinstance(posit, str):
            posit = "{0}".format(json.dumps(posit))
        posit = posit.replace("'", "'\"'\"'")
        # Add in encapsulating single quotes
        parts.append("'{0}'".format(posit))
    ret = " ".join(parts)
    return ret