diff --git a/evalai/login.py b/evalai/login.py index 001f2676c..f4a8dcfdc 100644 --- a/evalai/login.py +++ b/evalai/login.py @@ -6,18 +6,18 @@ from evalai.utils.auth import get_user_auth_token_by_login from evalai.utils.config import AUTH_TOKEN_PATH, AUTH_TOKEN_DIR +@click.command() -@click.group(invoke_without_command=True) -@click.pass_context -def login(ctx): - """ - Login to EvalAI and save token. - """ - username = click.prompt("username", type=str, hide_input=False) - password = click.prompt("Enter password", type=str, hide_input=True) - token = get_user_auth_token_by_login(username, password) - - if os.path.exists(AUTH_TOKEN_PATH): +@click.option('--auth') +@click.option('--host') +def main(auth,host): + + + a=click.prompt("AUTHENTICATION TOKEN") + h=click.prompt("HOST ID ") + token = get_user_auth_token_by_login(a, h) + + if os.path.exists(AUTH_TOKEN_PATH): with open(str(AUTH_TOKEN_PATH), "w") as TokenFile: try: json.dump(token, TokenFile) @@ -33,3 +33,6 @@ def login(ctx): echo(e) echo(style("\nLogged in successfully!", bold=True)) + +if __name__=='__main__': + main() diff --git a/evalai/main.py b/evalai/main.py index 34bb252cc..aee8d93c8 100644 --- a/evalai/main.py +++ b/evalai/main.py @@ -43,3 +43,4 @@ def main(ctx): main.add_command(teams) main.add_command(get_token) main.add_command(login) +main.add_command(configure)