Skip to content
Permalink
Browse files

(chocolateyGH-132) Make InstallCommand and UninstallCommand output re…

…sults for API purposes
  • Loading branch information...
Jaykul committed Apr 5, 2015
1 parent 5742f16 commit 3a0857087884d9f926b33e2518518694af2e714c
@@ -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;

@@ -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;
}
}
}
@@ -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;
@@ -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 3a08570

Please sign in to comment.
You can’t perform that action at this time.