Skip to content

Commit

Permalink
added version command
Browse files Browse the repository at this point in the history
  • Loading branch information
sparkingdark committed Feb 27, 2021
1 parent 1ac80bb commit c14836b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hub/cli/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

import click
import hub
from hub.log import logger
from hub import config
from hub.client.auth import AuthClient
Expand Down Expand Up @@ -33,7 +34,7 @@ def logout():
@click.option("--email", "-e", default=None, help="Your email")
@click.option("--password", "-p", default=None, help="Your Activeloop AI password")
def register(username, email, password):
""" Register at of Activeloop AI"""
""" Register at Activeloop AI"""
if not username:
logger.debug("Prompting for username.")
username = click.prompt("Username", type=str)
Expand Down Expand Up @@ -80,3 +81,4 @@ def login_fn(username, password):
TokenManager.set_token(token)
HubControlClient().get_credentials()
logger.info("Login Successful.")

11 changes: 11 additions & 0 deletions hub/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from hub.cli.auth import login, logout, register



@click.group()
@click.option(
"-h",
Expand All @@ -23,10 +24,20 @@ def cli(host, verbose):
configure_logger(verbose)


@click.command()
def version(version=1.22):
''' Get the version of the hub package
'''
click.echo(f"you are using the hub version:{version}")




def add_commands(cli):
cli.add_command(login)
cli.add_command(register)
cli.add_command(logout)
cli.add_command(version)


add_commands(cli)

0 comments on commit c14836b

Please sign in to comment.