remove command fixes

This commit is contained in:
Jon Sequeira 2017-03-15 09:27:27 -07:00
parent bbc2722cb7
commit c316b98c74
4 changed files with 33 additions and 10 deletions

View file

@ -16,19 +16,25 @@ namespace Microsoft.DotNet.Tools.Remove.PackageReference
private readonly AppliedOption _appliedCommand;
private readonly string _fileOrDirectory;
public RemovePackageReferenceCommand(AppliedOption appliedCommand)
public RemovePackageReferenceCommand(
AppliedOption appliedCommand,
string fileOrDirectory)
{
if (appliedCommand == null)
{
throw new ArgumentNullException(nameof(appliedCommand));
}
if (fileOrDirectory == null)
{
throw new ArgumentNullException(nameof(fileOrDirectory));
}
if (_appliedCommand.Arguments.Count != 1)
{
throw new GracefulException(LocalizableStrings.SpecifyExactlyOnePackageReference);
}
_appliedCommand = appliedCommand;
_fileOrDirectory = appliedCommand.Arguments.Single();
_fileOrDirectory = fileOrDirectory;
}
public override int Execute()