Allow to choose which library to update // Resolve #168

This commit is contained in:
Ivan Kravets committed 2015-04-16 17:34:22 +01:00
1 parent 8d75194884
commit a9942e675f
3 files changed
+35 -4

No files matched your search

+7 -2
View File
@@ -209,13 +209,18 @@ def lib_show(libid):
@cli.command("update", short_help="Update installed libraries")
@click.argument("libid", type=click.INT, nargs=-1, required=False,
metavar="[LIBRARY_ID]")
@click.pass_context
def lib_update(ctx):
def lib_update(ctx, libid):
lm = LibraryManager(get_lib_dir())
for id_, latest_version in (lm.get_latest_versions() or {}).items():
if libid and int(id_) not in libid:
continue
info = lm.get_info(int(id_))
click.echo("Updating [ %s ] %s library:" % (
click.echo("Updating [ %s ] %s library:" % (
click.style(id_, fg="yellow"),
click.style(info['name'], fg="cyan")))