diff --git a/HISTORY.rst b/HISTORY.rst index 9bbcf11f..41d4c90c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,15 @@ Release History =============== +2.0.0 (2015-??-??) +------------------ + +* Added global ``-f, --force`` option which will force to accept any + confirmation prompts (`issue #152 `_) +* Allowed to choose which library to update + (`issue #168 `_) + + 1.4.0 (2015-04-11) ------------------ diff --git a/docs/userguide/lib/cmd_update.rst b/docs/userguide/lib/cmd_update.rst index f719fa13..f58fab4c 100644 --- a/docs/userguide/lib/cmd_update.rst +++ b/docs/userguide/lib/cmd_update.rst @@ -10,7 +10,7 @@ Usage .. code-block:: bash - platformio lib update + platformio lib update [LIBRARY_ID] Description @@ -22,6 +22,8 @@ Check or update installed libraries Examples -------- +1. Update all installed libraries + .. code-block:: bash $ platformio lib update @@ -36,8 +38,23 @@ Examples # Updating [ 13 ] Adafruit-GFX library: # Versions: Current=a9e5bc4707, Latest=a9e5bc4707 [Up-to-date] # Updating [ 1 ] OneWire library: - # Versions: Current=2.2, Latest=2.2 [Up-to-date] + # Versions: Current=2.2, Latest=2.2 [Up-to-date] # Updating [ 4 ] IRremote library: # Versions: Current=f2dafe5030, Latest=f2dafe5030 [Up-to-date] # Updating [ 14 ] Adafruit-9DOF-Unified library: # Versions: Current=b2f07242ac, Latest=b2f07242ac [Up-to-date] + +2. Update specified libraries + +.. code-block:: bash + + $ platformio lib update 1 59 + # Updating [ 1 ] OneWire library: + # Versions: Current=2.2, Latest=2.2 [Up-to-date] + # Updating [ 59 ] USB-Host-Shield-20 library: + # Versions: Current=fcab83dcb3, Latest=c61f9ce1c2 [Out-of-date] + # The library #59 'USB-Host-Shield-20' has been successfully uninstalled! + # Installing library [ 59 ]: + # Downloading [####################################] 100% + # Unpacking [####################################] 100% + # The library #59 'USB-Host-Shield-20' has been successfully installed! diff --git a/platformio/commands/lib.py b/platformio/commands/lib.py index 91c8dced..da3d2b19 100644 --- a/platformio/commands/lib.py +++ b/platformio/commands/lib.py @@ -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")))