def gen_matches(self, word):
        """Generate a sequence of possible completions for ``word``.

        :param word: the word to complete
        """

        if word.startswith("$"):
            for match in self.gen_variable_completions(word, os.environ):
                yield match
        else:
            head, tail = os.path.split(word)
            filenames = os.listdir(head or '.')
            completions = self.gen_filename_completions(tail, filenames)
            for match in completions:
                yield os.path.join(head, match)
        for extension in self.extensions:
            for match in extension(word):
                yield match
Generate a sequence of possible completions for ``word``.

        :param word: the word to complete