Skip to content

Commit 9a5858c

Browse files
authored
[BLOCKED] update System.CommandLine (#1364)
* Reapply "update System.CommandLine (#1356)", but keep the removal of two dependencies (#1363) This reverts commit 3ce7edb. * Apply suggestions from code review
1 parent a67a604 commit 9a5858c

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

eng/Version.Details.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<Dependencies>
33
<Source Uri="https://github.com/dotnet/dotnet" Mapping="sourcelink" Sha="49f46ce3082f22cd016b9fffdae880a09b04afcd" BarId="262746" />
44
<ProductDependencies>
5-
<Dependency Name="System.CommandLine" Version="2.0.0-beta4.23307.1">
5+
<Dependency Name="System.CommandLine" Version="2.0.0-beta5.25208.1">
66
<Uri>https://github.com/dotnet/command-line-api</Uri>
7-
<Sha>02fe27cd6a9b001c8feb7938e6ef4b3799745759</Sha>
7+
<Sha>48bd86bdcd926a194e1581a60d820d12a64ef3c6</Sha>
88
</Dependency>
99
<!-- Intermediate is necessary for source build. -->
10-
<Dependency Name="Microsoft.SourceBuild.Intermediate.command-line-api" Version="0.1.430701">
10+
<Dependency Name="Microsoft.SourceBuild.Intermediate.command-line-api" Version="0.1.620801">
1111
<Uri>https://github.com/dotnet/command-line-api</Uri>
12-
<Sha>02fe27cd6a9b001c8feb7938e6ef4b3799745759</Sha>
12+
<Sha>48bd86bdcd926a194e1581a60d820d12a64ef3c6</Sha>
1313
<SourceBuild RepoName="command-line-api" ManagedOnly="true" />
1414
</Dependency>
1515
<!-- Intermediate is necessary for source build. -->

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111
<PropertyGroup>
1212
<!-- commandline -->
13-
<SystemCommandLineVersion>2.0.0-beta4.23307.1</SystemCommandLineVersion>
13+
<SystemCommandLineVersion>2.0.0-beta5.25208.1</SystemCommandLineVersion>
1414
<!-- msbuild -->
1515
<MicrosoftBuildVersion>17.8.3</MicrosoftBuildVersion>
1616
<MicrosoftBuildTasksCoreVersion>17.8.3</MicrosoftBuildTasksCoreVersion>

src/dotnet-sourcelink/Program.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,42 +59,42 @@ private static string GetSourceLinkVersion()
5959
return attribute.InformationalVersion.Split('+').First();
6060
}
6161

62-
private static CliRootCommand GetRootCommand()
62+
private static RootCommand GetRootCommand()
6363
{
64-
var pathArg = new CliArgument<string>("path")
64+
var pathArg = new Argument<string>("path")
6565
{
6666
Description = "Path to an assembly or .pdb"
6767
};
68-
var authArg = new CliOption<string>("--auth", "-a")
68+
var authArg = new Option<string>("--auth", "-a")
6969
{
7070
Description = "Authentication method"
7171
};
7272
authArg.AcceptOnlyFromAmong(AuthenticationMethod.Basic);
7373

74-
var authEncodingArg = new CliOption<Encoding>("--auth-encoding", "-e")
74+
var authEncodingArg = new Option<Encoding>("--auth-encoding", "-e")
7575
{
7676
CustomParser = arg => Encoding.GetEncoding(arg.Tokens.Single().Value),
7777
Description = "Encoding to use for authentication value"
7878
};
7979

80-
var userArg = new CliOption<string>("--user", "-u")
80+
var userArg = new Option<string>("--user", "-u")
8181
{
8282
Description = "Username to use to authenticate",
8383
Arity = ArgumentArity.ExactlyOne
8484
};
8585

86-
var passwordArg = new CliOption<string>("--password", "-p")
86+
var passwordArg = new Option<string>("--password", "-p")
8787
{
8888
Description = "Password to use to authenticate",
8989
Arity = ArgumentArity.ExactlyOne
9090
};
9191

92-
var offlineArg = new CliOption<bool>("--offline")
92+
var offlineArg = new Option<bool>("--offline")
9393
{
9494
Description = "Offline mode - skip validation of sourcelink URL targets"
9595
};
9696

97-
var test = new CliCommand("test", "TODO")
97+
var test = new Command("test", "TODO")
9898
{
9999
pathArg,
100100
authArg,
@@ -116,25 +116,25 @@ private static CliRootCommand GetRootCommand()
116116
return TestAsync(path, authMethod, authEncoding, user, password, offline, parseResult, cancellationToken);
117117
});
118118

119-
var printJson = new CliCommand("print-json", "Print Source Link JSON stored in the PDB")
119+
var printJson = new Command("print-json", "Print Source Link JSON stored in the PDB")
120120
{
121121
pathArg
122122
};
123123
printJson.SetAction((parseResult, ct) => PrintJsonAsync(parseResult.GetValue(pathArg)!, parseResult));
124124

125-
var printDocuments = new CliCommand("print-documents", "TODO")
125+
var printDocuments = new Command("print-documents", "TODO")
126126
{
127127
pathArg
128128
};
129129
printDocuments.SetAction((parseResult, ct) => PrintDocumentsAsync(parseResult.GetValue(pathArg)!, parseResult));
130130

131-
var printUrls = new CliCommand("print-urls", "TODO")
131+
var printUrls = new Command("print-urls", "TODO")
132132
{
133133
pathArg
134134
};
135135
printUrls.SetAction((parseResult, ct) => PrintUrlsAsync(parseResult.GetValue(pathArg)!, parseResult));
136136

137-
var root = new CliRootCommand()
137+
var root = new RootCommand()
138138
{
139139
test,
140140
printJson,

0 commit comments

Comments
 (0)