#!/usr/bin/env python3

import argparse

usage = """list-members [options]

List the names and e-mail addresses of the people in your realm.

Example: list-members

Specify your Zulip API credentials and server in a ~/.zuliprc file or using the options.
"""

import zulip

parser = zulip.add_default_arguments(argparse.ArgumentParser(usage=usage))
options = parser.parse_args()

client = zulip.init_from_options(options)

for user in client.get_users()["members"]:
    print(user["full_name"], user["email"])
