-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "[main] Update dependencies from dotnet/command-line-a…
…pi (#29131)""
- Loading branch information
1 parent
3eec09e
commit 7962096
Showing
191 changed files
with
3,366 additions
and
3,065 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
355 changes: 196 additions & 159 deletions
355
src/ApiCompat/Microsoft.DotNet.ApiCompat.Tool/Program.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/Cli/Microsoft.DotNet.Cli.Utils/Extensions/StringExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.DotNet.Cli.Utils.Extensions | ||
{ | ||
public static class StringExtensions | ||
{ | ||
public static string RemovePrefix(this string name) | ||
{ | ||
int prefixLength = GetPrefixLength(name); | ||
|
||
return prefixLength > 0 | ||
? name.Substring(prefixLength) | ||
: name; | ||
|
||
static int GetPrefixLength(string name) | ||
{ | ||
if (name[0] == '-') | ||
{ | ||
return name.Length > 1 && name[1] == '-' | ||
? 2 | ||
: 1; | ||
} | ||
|
||
if (name[0] == '/') | ||
{ | ||
return 1; | ||
} | ||
|
||
return 0; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.