Implement "lib register" command

This commit is contained in:
Ivan Kravets
2014-09-08 22:02:57 +03:00
parent c4b28ab252
commit 813c818477
2 changed files with 16 additions and 3 deletions

View File

@@ -131,3 +131,12 @@ def lib_update():
lib_uninstall([name])
lib_install([name])
@cli.command("register", short_help="Register new library")
@argument("config_url")
def lib_register(config_url):
result = get_api_result("/lib/register", data=dict(config_url=config_url))
if "message" in result and result['message']:
secho(result['message'], fg="green" if "successed" in result and
result['successed'] else "red")