def py2_replace_help(argv):
    """

    Workaround for Python 2.7 argparse, which does not accept empty COMMAND

    If `--help` or `-h` present and every argument before it begins with `-`,
    then convert it to `help`.
    """
    try:
        ind = argv.index('--help')
    except ValueError:
        try:
            ind = argv.index('-h')
        except ValueError:
            ind = None
    if ind is not None:
        for k in range(ind):
            if argv[k][0] != '-':
                ind = None
                break
        if ind is not None:
            argv[ind] = 'help'
    return argv
