def sort_completions(completions_gen):
    from knack.help import REQUIRED_TAG
    def _get_weight(val):
        priority = ''
        if val.display_meta and val.display_meta.startswith(REQUIRED_TAG):
            priority = ' '
        return priority + val.text
    return sorted(completions_gen, key=_get_weight)