Skip to content

Commit 90db05b

Browse files
committed
Added method to retrieve the list of users
Fixes #34
1 parent 258dbc8 commit 90db05b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

bin/cli.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,24 @@ def create(
821821
print("User already exists.")
822822
sys.exit(1)
823823

824+
def list(
825+
self, output = "table", columns = User.default_display_fields,
826+
):
827+
"""Retrieve the list of Users
828+
:param output: how to display the output [text|table|json]
829+
"""
830+
if output == "table":
831+
print(get_client().user.list().tabulate(columns=columns))
832+
elif output == "text":
833+
print(
834+
get_client()
835+
.user.list()
836+
.tabulate(
837+
columns=columns, style="plain", display_headers=False,
838+
)
839+
)
840+
else:
841+
print(get_client().user.list().json)
824842
# raise NotImplementedError
825843

826844

0 commit comments

Comments
 (0)