from typing import Optional
from typing import List


def _with_config_file_cmd(config_file: Optional[str], cmd: List[str]):
    """ Prefixes `cmd` with ["--config-file", config_file] if
        config_file is not None """
    return (["--config-file", config_file] if config_file else []) + cmd