You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var projectArg = new Arg("Project", "", "string", "The project or solution file to operate on. If not specified, the command searches the current directory for one. If more than one solution or project is found, an error is thrown.") { IsProject = true };
22
22
var solutionArg = new Arg("Solution", "", "string", "The solution file to use. If this argument is omitted, the command searches the current directory for one. If it finds no solution file or multiple solution files, the command fails.") { IsProject = true };
23
23
var propsArg = new Arg("Props", "--property", "IEnumerable<(string name, string value)>", "MSBuild options for setting properties.") { IsCollection = true };
@@ -116,11 +116,11 @@ using Internal;
116
116
paraFinish,
117
117
CreateCliRef("dotnet-add-package")
118
118
],
119
-
["add", "$Project", "package", "$PackageName"],
119
+
["add", "$Project", "package", "$Package"],
120
120
[
121
121
sourcesArg,
122
122
projectArg,
123
-
new Arg("PackageName", "", "string", "The package reference to add."),
123
+
new Arg("Package", "", "string", "The package reference to add."),
124
124
frameworkArg with { Comments = "Adds a package reference only when targeting a specific framework." },
125
125
noRestoreArg,
126
126
new Arg("PackageDirectory", "--package-directory", "string", @"The directory where to restore the packages. The default package restore location is %userprofile%\.nuget\packages on Windows and ~/.nuget/packages on macOS and Linux."),
new Arg("PackageName", "", "string", "The package reference to add."),
169
+
new Arg("Package", "", "string", "The package reference to add."),
170
170
diagnosticsArg
171
171
]
172
172
),
@@ -229,15 +229,6 @@ using Internal;
229
229
paraStart,
230
230
"For executable projects targeting .NET Core 3.0 and later, library dependencies are copied to the output folder. This means that if there isn't any other publish-specific logic (such as Web projects have), the build output should be deployable.",
"new DotNetBuild().WithConfiguration(configuration)",
238
-
" .Build().EnsureSuccess();",
239
-
codeFinish,
240
-
exampleFinish,
241
232
CreateCliRef("dotnet-build")
242
233
],
243
234
["build", "$Project"],
@@ -344,15 +335,6 @@ using Internal;
344
335
paraStart,
345
336
"This command creates a .NET project or other artifacts based on a template. The command calls the template engine to create the artifacts on disk based on the specified template and options.",
new Arg("PackageName", "", "string", "Name/ID of the package to delete.") { IsProject = true },
485
+
new Arg("Package", "", "string", "Name/ID of the package to delete.") { IsProject = true },
504
486
new Arg("PackageVersion", "", "string", "Version of the package to delete.") { IsProject = true },
505
487
new Arg("ForceEnglishOutput", "--force-english-output", "bool?", "Forces the application to run using an invariant, English-based culture."),
506
488
new Arg("ApiKey", "--api-key", "string", "The API key for the server."),
@@ -931,12 +913,6 @@ using Internal;
931
913
paraStart,
932
914
"By default, dotnet pack builds the project first. If you wish to avoid this behavior, pass the --no-build option. This option is often useful in Continuous Integration (CI) build scenarios where you know the code was previously built.",
933
915
paraFinish,
934
-
exampleStart,
935
-
codeStart,
936
-
"new DotNetPack()",
937
-
" .Build().EnsureSuccess();",
938
-
codeFinish,
939
-
exampleFinish,
940
916
CreateCliRef("dotnet-pack")
941
917
],
942
918
["pack", "$Project"],
@@ -997,12 +973,6 @@ using Internal;
997
973
paraStart,
998
974
"This command compiles the application, reads through its dependencies specified in the project file, and publishes the resulting set of files to a directory.",
999
975
paraFinish,
1000
-
exampleStart,
1001
-
codeStart,
1002
-
"new DotNetPublish().AddProps((\"PublishDir\", \".publish\"))",
1003
-
" .Build().EnsureSuccess();",
1004
-
codeFinish,
1005
-
exampleFinish,
1006
976
CreateCliRef("dotnet-publish")
1007
977
],
1008
978
["publish", "$Project"],
@@ -1044,12 +1014,6 @@ using Internal;
1044
1014
paraStart,
1045
1015
"Sometimes, it might be inconvenient to run the implicit NuGet restore with these commands. For example, some automated systems, such as build systems, need to call dotnet restore explicitly to control when the restore occurs so that they can control network usage. To prevent the implicit NuGet restore, you can use the --no-restore flag with any of these commands.",
1046
1016
paraFinish,
1047
-
exampleStart,
1048
-
codeStart,
1049
-
"new DotNetRestore()",
1050
-
" .Build().EnsureSuccess();",
1051
-
codeFinish,
1052
-
exampleFinish,
1053
1017
CreateCliRef("dotnet-restore")
1054
1018
],
1055
1019
["restore", "$Project"],
@@ -1088,19 +1052,6 @@ using Internal;
1088
1052
paraStart,
1089
1053
"To run the application, the dotnet run command resolves the dependencies of the application that are outside of the shared runtime from the NuGet cache. Because it uses cached dependencies, it's not recommended to use dotnet run to run applications in production. Instead, create a deployment using the dotnet publish command and deploy the published output.",
1090
1054
paraFinish,
1091
-
exampleStart,
1092
-
codeStart,
1093
-
"new DotNetNew()",
1094
-
" .WithTemplateName(\"console\")",
1095
-
" .WithName(\"MyApp\")",
1096
-
" .WithForce(true)",
1097
-
" .Run().EnsureSuccess();",
1098
-
"",
1099
-
"",
1100
-
"new DotNetRun().WithWorkingDirectory(\"MyApp\")",
1101
-
" .Build().EnsureSuccess();",
1102
-
codeFinish,
1103
-
exampleFinish,
1104
1055
CreateCliRef("dotnet-run")
1105
1056
],
1106
1057
["run"],
@@ -1210,19 +1161,6 @@ using Internal;
1210
1161
paraStart,
1211
1162
"For multi-targeted projects, tests are run for each targeted framework. The test host and the unit test framework are packaged as NuGet packages and are restored as ordinary dependencies for the project. Starting with the .NET 9 SDK, these tests are run in parallel by default. To disable parallel execution, set the TestTfmsInParallel MSBuild property to false.",
1212
1163
paraFinish,
1213
-
exampleStart,
1214
-
codeStart,
1215
-
"new DotNetNew()",
1216
-
" .WithTemplateName(\"mstest\")",
1217
-
" .WithName(\"MyTests\")",
1218
-
" .WithForce(true)",
1219
-
" .Run().EnsureSuccess();",
1220
-
"",
1221
-
"",
1222
-
"new DotNetTest().WithWorkingDirectory(\"MyTests\")",
1223
-
" .Build().EnsureSuccess();",
1224
-
codeFinish,
1225
-
exampleFinish,
1226
1164
CreateCliRef("dotnet-test")
1227
1165
],
1228
1166
["test", "$Project"],
@@ -1636,6 +1574,33 @@ using Internal;
1636
1574
/// <#= comment #>
1637
1575
<#
1638
1576
}
1577
+
1578
+
var exampleFile = Path.Combine("..", "CSharpInteractive.Tests", "UsageScenarios", "Comments", $"{command.Name}Scenario.txt");
1579
+
if (File.Exists(exampleFile))
1580
+
{
1581
+
var exampleLines = File.ReadAllLines(exampleFile);
1582
+
if (exampleLines.Length > 0)
1583
+
{
1584
+
#>
1585
+
/// <#= exampleStart #>
1586
+
///<#= codeStart #>
1587
+
<#
1588
+
var doc = new XmlDocument();
1589
+
foreach (var exampleLine in exampleLines.Select(i => i.TrimEnd()))
1590
+
{
1591
+
var node = doc.CreateElement("root");
1592
+
node.InnerText = exampleLine;
1593
+
var line = node.InnerXml;
1594
+
#>
1595
+
/// <#= line #>
1596
+
<#
1597
+
}
1598
+
#>
1599
+
///<#= codeFinish #>
1600
+
/// <#= exampleFinish #>
1601
+
<#
1602
+
}
1603
+
}
1639
1604
#>
1640
1605
/// </summary>
1641
1606
/// <param name="Args">Specifies the set of command line arguments to use when starting the tool.</param>
0 commit comments