-
Notifications
You must be signed in to change notification settings - Fork 1
/
cli.py
37 lines (25 loc) · 604 Bytes
/
cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import click
import requests
from user_model import User
from db import database
@click.group()
def main():
"""
Simple CLI for a chat room
"""
database.create_tables()
@main.command()
def register():
email = input('Please enter a valid email: ')
password = input('Please enter a valid password: ')
role = input('Please enter a role: ')
new_user = User(email, password, role)
new_user.save_user()
click.echo(new_user)
@main.command()
@click.argument('id')
@click.argument('email')
def post(id, email):
pass
if __name__ == "__main__":
main()