Skip to content

Commit

Permalink
(chocolateyGH-132) Make InstallCommand and UninstallCommand output re…
Browse files Browse the repository at this point in the history
…sults for API purposes
  • Loading branch information
Jaykul committed Apr 8, 2015
1 parent 4706516 commit b6c91b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Expand Up @@ -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<PackageResult>
{
private readonly IChocolateyPackageService _packageService;

Expand Down Expand Up @@ -165,5 +166,10 @@ public void run(ChocolateyConfiguration configuration)
{
_packageService.install_run(configuration);
}

public IEnumerable<PackageResult> list(ChocolateyConfiguration configuration)
{
return _packageService.install_run(configuration).Values;
}
}
}
Expand Up @@ -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<PackageResult>
{
private readonly IChocolateyPackageService _packageService;

public ChocolateyUninstallCommand(IChocolateyPackageService packageService)
{
_packageService = packageService;
Expand Down Expand Up @@ -130,5 +131,10 @@ public void run(ChocolateyConfiguration configuration)
{
_packageService.uninstall_run(configuration);
}

public IEnumerable<PackageResult> list(ChocolateyConfiguration configuration)
{
return _packageService.uninstall_run(configuration).Values;
}
}
}

0 comments on commit b6c91b2

Please sign in to comment.