def subcommand(helpcmd, line):
    """Return a help command for a subgroup.

    helpcmd = an Azure CLI help command (e.g., 'az vm -h')
    line = line of text beginning with a subgroup
        (e.g., 'create        : Create an Azure Virtual Machine.')

    Returns the command for getting help on this subgroup
    (e.g., 'az vm create -h')
    """
    # sometimes need to remove trailing ':'
    subgroup = line.strip().split(' ')[0].rstrip(':')

    # create list of arguments before the -h
    rootcommand = helpcmd.split(' ')[:-1]

    # add this subgroup and -h
    rootcommand.extend([subgroup, '-h'])

    return ' '.join(rootcommand)