Skip to content

Commit 9badd70

Browse files
authored
Add default for dotnet reference list Fixes #48555 (#48825)
2 parents b3d69dd + ca95d25 commit 9badd70

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Cli/dotnet/Commands/Hidden/Add/Package/AddPackageCommandParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private static Command ConstructCommand()
4343
}
4444
else
4545
{
46-
return new PackageAddCommand(parseResult, parseResult.GetValue(AddCommandParser.ProjectArgument)).Execute();
46+
return new PackageAddCommand(parseResult, parseResult.GetValue(AddCommandParser.ProjectArgument) ?? Directory.GetCurrentDirectory()).Execute();
4747
}
4848
});
4949

src/Cli/dotnet/Commands/Reference/List/ReferenceListCommand.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public ReferenceListCommand(
2222

2323
_fileOrDirectory = parseResult.HasOption(ReferenceCommandParser.ProjectOption) ?
2424
parseResult.GetValue(ReferenceCommandParser.ProjectOption) :
25-
parseResult.GetValue(ListCommandParser.SlnOrProjectArgument);
25+
parseResult.GetValue(ListCommandParser.SlnOrProjectArgument) ??
26+
Directory.GetCurrentDirectory();
2627
}
2728

2829
public override int Execute()

0 commit comments

Comments
 (0)