From b6c91b2dce884622060f688b3ae4d131cbd08b0e Mon Sep 17 00:00:00 2001 From: Joel Bennett Date: Sun, 5 Apr 2015 02:00:50 -0400 Subject: [PATCH] (GH-132) Make InstallCommand and UninstallCommand output results for API purposes --- .../commands/ChocolateyInstallCommand.cs | 8 +++++++- .../commands/ChocolateyUninstallCommand.cs | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs index c2b8af1969..f4a4c6fa3e 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs @@ -23,10 +23,11 @@ namespace chocolatey.infrastructure.app.commands using domain; using infrastructure.commands; using logging; + using results; using services; [CommandFor(CommandNameType.install)] - public sealed class ChocolateyInstallCommand : ICommand + public sealed class ChocolateyInstallCommand : IListCommand { private readonly IChocolateyPackageService _packageService; @@ -165,5 +166,10 @@ public void run(ChocolateyConfiguration configuration) { _packageService.install_run(configuration); } + + public IEnumerable list(ChocolateyConfiguration configuration) + { + return _packageService.install_run(configuration).Values; + } } } \ No newline at end of file diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs index 2cea4a1408..fee00ca37e 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs @@ -23,13 +23,14 @@ namespace chocolatey.infrastructure.app.commands using domain; using infrastructure.commands; using logging; + using results; using services; [CommandFor(CommandNameType.uninstall)] - public sealed class ChocolateyUninstallCommand : ICommand + public sealed class ChocolateyUninstallCommand : IListCommand { private readonly IChocolateyPackageService _packageService; - + public ChocolateyUninstallCommand(IChocolateyPackageService packageService) { _packageService = packageService; @@ -130,5 +131,10 @@ public void run(ChocolateyConfiguration configuration) { _packageService.uninstall_run(configuration); } + + public IEnumerable list(ChocolateyConfiguration configuration) + { + return _packageService.uninstall_run(configuration).Values; + } } } \ No newline at end of file