Allowed to pass multiple "SomePlatform" to the install/uninstall commands

This commit is contained in:
Ivan Kravets
2014-06-19 23:21:59 +03:00
parent b6809f0d3f
commit d801e65adf
4 changed files with 19 additions and 19 deletions

View File

@@ -9,13 +9,15 @@ from platformio.platforms._base import PlatformFactory
@command("uninstall", short_help="Uninstall the platforms")
@argument("platform")
def cli(platform):
@argument("platforms", nargs=-1)
def cli(platforms):
if platform not in PackageManager.get_installed():
raise PlatformNotInstalledYet(platform)
for platform in platforms:
p = PlatformFactory().newPlatform(platform)
if p.uninstall():
secho("The platform '%s' has been successfully "
"uninstalled!" % platform, fg="green")
if platform not in PackageManager.get_installed():
raise PlatformNotInstalledYet(platform)
p = PlatformFactory().newPlatform(platform)
if p.uninstall():
secho("The platform '%s' has been successfully "
"uninstalled!" % platform, fg="green")