Skip to content

Commit 7c7e546

Browse files
[main] Update dependencies from dotnet/command-line-api (#6222)
* Update dependencies from https://github.com/dotnet/command-line-api build 20230307.2 System.CommandLine From Version 2.0.0-beta4.23152.1 -> To Version 2.0.0-beta4.23157.2 * Adjust the code following breaking change in Option ctor by dotnet/command-line-api#2073 --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Gang Wang <[email protected]>
1 parent 8c02d28 commit 7c7e546

File tree

5 files changed

+33
-34
lines changed

5 files changed

+33
-34
lines changed

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
<Uri>https://github.com/dotnet/runtime</Uri>
2020
<Sha>6123cb00bbec8ae3500c970890f5b0efcf7950e8</Sha>
2121
</Dependency>
22-
<Dependency Name="System.CommandLine" Version="2.0.0-beta4.23152.1">
22+
<Dependency Name="System.CommandLine" Version="2.0.0-beta4.23157.2">
2323
<Uri>https://github.com/dotnet/command-line-api</Uri>
24-
<Sha>d5b63a05d9f4619dea0be897d3acc0ad5272874e</Sha>
24+
<Sha>c63e231c1e5102c51bd9247a4f3feec9175d601d</Sha>
2525
</Dependency>
2626
</ProductDependencies>
2727
<ToolsetDependencies>

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<PropertyGroup>
1717
<!-- Maestro-managed Package Versions - Ordered by repo name -->
1818
<!-- Dependencies from https://github.com/dotnet/command-line-api -->
19-
<SystemCommandLinePackageVersion>2.0.0-beta4.23152.1</SystemCommandLinePackageVersion>
19+
<SystemCommandLinePackageVersion>2.0.0-beta4.23157.2</SystemCommandLinePackageVersion>
2020
<!-- Dependencies from https://github.com/dotnet/runtime -->
2121
<MicrosoftNETCoreAppRefPackageVersion>8.0.0-preview.3.23155.6</MicrosoftNETCoreAppRefPackageVersion>
2222
<MicrosoftNETCoreAppRuntimewinx64PackageVersion>8.0.0-preview.3.23155.6</MicrosoftNETCoreAppRuntimewinx64PackageVersion>

tools/Microsoft.TemplateEngine.Authoring.CLI/Commands/Verify/VerifyCommand.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,65 +19,65 @@ internal class VerifyCommand : ExecutableCommand<VerifyCommandArgs>
1919
Arity = new ArgumentArity(1, 1)
2020
};
2121

22-
private readonly Option<string> _remainingArguments = new Option<string>("--template-args")
22+
private readonly Option<string> _remainingArguments = new Option<string>("template-args", new[] { "--template-args" })
2323
{
2424
Description = "Template specific arguments - all joined into single enquoted string. Any needed quotations of actual arguments has to be escaped.",
2525
Arity = new ArgumentArity(0, 1)
2626
};
2727

28-
private readonly Option<string> _templatePathOption = new(new[] { "-p", "--template-path" })
28+
private readonly Option<string> _templatePathOption = new("template-path", new[] { "-p", "--template-path" })
2929
{
3030
Description = LocalizableStrings.command_verify_help_templatePath_description,
3131
};
3232

33-
private readonly Option<string> _templateOutputPathOption = new(new[] { "-o", "--output" })
33+
private readonly Option<string> _templateOutputPathOption = new("output", new[] { "-o", "--output" })
3434
{
3535
Description = LocalizableStrings.command_verify_help_outputPath_description,
3636
};
3737

38-
private readonly Option<string> _snapshotsDirectoryOption = new(new[] { "-d", "--snapshots-directory" })
38+
private readonly Option<string> _snapshotsDirectoryOption = new("snapshots-directory", new[] { "-d", "--snapshots-directory" })
3939
{
4040
Description = LocalizableStrings.command_verify_help_snapshotsDirPath_description,
4141
};
4242

43-
private readonly Option<string> _scenarioNameOption = new(new[] { "--scenario-name" })
43+
private readonly Option<string> _scenarioNameOption = new("scenario-name", new[] { "--scenario-name" })
4444
{
4545
Description = LocalizableStrings.command_verify_help_scenarioName_description,
4646
};
4747

48-
private readonly Option<bool> _disableDiffToolOption = new("--disable-diff-tool")
48+
private readonly Option<bool> _disableDiffToolOption = new("disable-diff-tool", new[] { "--disable-diff-tool" })
4949
{
5050
Description = LocalizableStrings.command_verify_help_disableDiffTool_description,
5151
};
5252

53-
private readonly Option<bool> _disableDefaultExcludePatternsOption = new("--disable-default-exclude-patterns")
53+
private readonly Option<bool> _disableDefaultExcludePatternsOption = new("disable-default-exclude-patterns", new[] { "--disable-default-exclude-patterns" })
5454
{
5555
Description = LocalizableStrings.command_verify_help_disableDefaultExcludes_description,
5656
};
5757

58-
private readonly Option<IEnumerable<string>> _excludePatternOption = new("--exclude-pattern")
58+
private readonly Option<IEnumerable<string>> _excludePatternOption = new("exclude-pattern", new[] { "--exclude-pattern" })
5959
{
6060
Description = LocalizableStrings.command_verify_help_customExcludes_description,
6161
Arity = new ArgumentArity(0, 999)
6262
};
6363

64-
private readonly Option<IEnumerable<string>> _includePatternOption = new("--include-pattern")
64+
private readonly Option<IEnumerable<string>> _includePatternOption = new("include-pattern", new[] { "--include-pattern" })
6565
{
6666
Description = LocalizableStrings.command_verify_help_customIncludes_description,
6767
Arity = new ArgumentArity(0, 999)
6868
};
6969

70-
private readonly Option<bool> _verifyCommandOutputOption = new("--verify-std")
70+
private readonly Option<bool> _verifyCommandOutputOption = new("verify-std", new[] { "--verify-std" })
7171
{
7272
Description = LocalizableStrings.command_verify_help_verifyOutputs_description,
7373
};
7474

75-
private readonly Option<bool> _isCommandExpectedToFailOption = new("--fail-expected")
75+
private readonly Option<bool> _isCommandExpectedToFailOption = new("fail-expected", new[] { "--fail-expected" })
7676
{
7777
Description = LocalizableStrings.command_verify_help_expectFailure_description,
7878
};
7979

80-
private readonly Option<IEnumerable<UniqueForOption>> _uniqueForOption = new("--unique-for")
80+
private readonly Option<IEnumerable<UniqueForOption>> _uniqueForOption = new("unique-for", new[] { "--unique-for" })
8181
{
8282
Description = LocalizableStrings.command_verify_help_uniqueFor_description,
8383
Arity = new ArgumentArity(0, 999),

tools/Microsoft.TemplateEngine.Authoring.CLI/Commands/localize/export/ExportCommand.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,20 @@ internal sealed class ExportCommand : ExecutableCommand<ExportCommandArgs>
1717
Description = LocalizableStrings.command_export_help_templatePath_description,
1818
};
1919

20-
private readonly Option<IEnumerable<string>> _languageOption = new("-l")
20+
private readonly Option<IEnumerable<string>> _languageOption = new("language", new[] { "--language", "-l" })
2121
{
22-
Name = "--language",
2322
Description = LocalizableStrings.command_export_help_language_description,
2423
Arity = ArgumentArity.OneOrMore,
2524
AllowMultipleArgumentsPerToken = true,
2625
};
2726

28-
private readonly Option<bool> _recursiveOption = new("-r")
27+
private readonly Option<bool> _recursiveOption = new("recursive", new[] { "--recursive", "-r" })
2928
{
30-
Name = "--recursive",
3129
Description = LocalizableStrings.command_export_help_recursive_description,
3230
};
3331

34-
private readonly Option<bool> _dryRunOption = new("-d")
32+
private readonly Option<bool> _dryRunOption = new("dry-run", new[] { "--dry-run", "-d" })
3533
{
36-
Name = "--dry-run",
3734
Description = LocalizableStrings.command_export_help_dryrun_description,
3835
};
3936

tools/Microsoft.TemplateSearch.TemplateDiscovery/TemplateDiscoveryCommand.cs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,71 +14,73 @@ internal class TemplateDiscoveryCommand : Command
1414
{
1515
private const int DefaultPageSize = 100;
1616

17-
private readonly Option<DirectoryInfo> _basePathOption = new Option<DirectoryInfo>("--basePath")
17+
private readonly Option<DirectoryInfo> _basePathOption = new Option<DirectoryInfo>("basePath", new[] { "--basePath" })
1818
{
1919
Arity = ArgumentArity.ExactlyOne,
2020
Description = "The root dir for output for this run.",
2121
IsRequired = true
2222
};
2323

24-
private readonly Option<bool> _allowPreviewPacksOption = new Option<bool>("--allowPreviewPacks")
24+
private readonly Option<bool> _allowPreviewPacksOption = new Option<bool>("allowPreviewPacks", new[] { "--allowPreviewPacks" })
2525
{
2626
Description = "Include preview packs in the results (by default, preview packs are ignored and the latest stable pack is used.",
2727
};
2828

29-
private readonly Option<int> _pageSizeOption = new Option<int>("--pageSize", defaultValueFactory: () => DefaultPageSize)
29+
private readonly Option<int> _pageSizeOption = new Option<int>("pageSize", new[] { "--pageSize" })
3030
{
3131
Description = "(debugging) The chunk size for interactions with the source.",
32+
DefaultValueFactory = (r) => DefaultPageSize,
3233
};
3334

34-
private readonly Option<bool> _onePageOption = new Option<bool>("--onePage")
35+
private readonly Option<bool> _onePageOption = new Option<bool>("onePage", new[] { "--onePage" })
3536
{
3637
Description = "(debugging) Only process one page of template packs.",
3738
};
3839

39-
private readonly Option<bool> _savePacksOption = new Option<bool>("--savePacks")
40+
private readonly Option<bool> _savePacksOption = new Option<bool>("savePacks", new[] { "--savePacks" })
4041
{
4142
Description = "Don't delete downloaded candidate packs (by default, they're deleted at the end of a run).",
4243
};
4344

44-
private readonly Option<bool> _noTemplateJsonFilterOption = new Option<bool>("--noTemplateJsonFilter")
45+
private readonly Option<bool> _noTemplateJsonFilterOption = new Option<bool>("noTemplateJsonFilter", new[] { "--noTemplateJsonFilter" })
4546
{
4647
Description = "Don't prefilter packs that don't contain any template.json files (this filter is applied by default).",
4748
};
4849

49-
private readonly Option<bool> _verboseOption = new Option<bool>(new[] { "-v", "--verbose" })
50+
private readonly Option<bool> _verboseOption = new Option<bool>("verbose", new[] { "-v", "--verbose" })
5051
{
5152
Description = "Verbose output for template processing.",
5253
};
5354

54-
private readonly Option<bool> _testOption = new Option<bool>(new[] { "-t", "--test" })
55+
private readonly Option<bool> _testOption = new Option<bool>("test", new[] { "-t", "--test" })
5556
{
5657
Description = "Run tests on generated metadata files.",
5758
};
5859

59-
private readonly Option<SupportedQueries[]> _queriesOption = new Option<SupportedQueries[]>("--queries")
60+
private readonly Option<SupportedQueries[]> _queriesOption = new Option<SupportedQueries[]>("queries", new[] { "--queries" })
6061
{
6162
Arity = ArgumentArity.OneOrMore,
6263
Description = $"The list of providers to run. Supported providers: {string.Join(",", Enum.GetValues<SupportedQueries>())}.",
6364
AllowMultipleArgumentsPerToken = true,
6465
};
6566

66-
private readonly Option<DirectoryInfo> _packagesPathOption = new Option<DirectoryInfo>("--packagesPath")
67+
private readonly Option<DirectoryInfo> _packagesPathOption = new Option<DirectoryInfo>("packagesPath", new[] { "--packagesPath" })
6768
{
6869
Description = $"Path to pre-downloaded packages. If specified, the packages won't be downloaded from NuGet.org.",
6970
}.AcceptExistingOnly();
7071

71-
private readonly Option<bool> _diffOption = new Option<bool>("--diff", defaultValueFactory: () => true)
72+
private readonly Option<bool> _diffOption = new Option<bool>("diff", new[] { "--diff" })
7273
{
7374
Description = $"The list of packages will be compared with previous run, and if package version is not changed, the package won't be rescanned.",
75+
DefaultValueFactory = (r) => true,
7476
};
7577

76-
private readonly Option<FileInfo> _diffOverrideCacheOption = new Option<FileInfo>("--diff-override-cache")
78+
private readonly Option<FileInfo> _diffOverrideCacheOption = new Option<FileInfo>("diff-override-cache", new[] { "--diff-override-cache" })
7779
{
7880
Description = $"Location of current search cache (local path only).",
7981
}.AcceptExistingOnly();
8082

81-
private readonly Option<FileInfo> _diffOverrideNonPackagesOption = new Option<FileInfo>("--diff-override-non-packages")
83+
private readonly Option<FileInfo> _diffOverrideNonPackagesOption = new Option<FileInfo>("diff-override-non-packages", new[] { "--diff-override-non-packages" })
8284
{
8385
Description = $"Location of the list of packages known not to be a valid package (local path only).",
8486
}.AcceptExistingOnly();

0 commit comments

Comments
 (0)