remove command fixes
This commit is contained in:
parent
bbc2722cb7
commit
c316b98c74
4 changed files with 33 additions and 10 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue