def get_installed_package_names(command):
    """Given a Command object, return a list of package names"""
    pkgs = []
    if command.is_set() and command.is_install():
        for word in command.words:
            pkgs.append(word)
    return pkgs
