Skip to content

Commit 7146ca4

Browse files
committed
R: clean up some code
1 parent fb9fbc2 commit 7146ca4

16 files changed

+60
-130
lines changed

src/System.CommandLine.Rendering.Tests/ConsoleRendererTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using static System.CommandLine.Rendering.TestTerminal;
1212
using static System.Environment;
1313
using System.CommandLine.Rendering.Views;
14-
using System.CommandLine.Tests;
1514
using System.CommandLine.Tests.Utility;
1615

1716
namespace System.CommandLine.Rendering.Tests

src/System.CommandLine.Rendering.Tests/TextSpanVisitorTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using System.Collections.Generic;
5-
using System.CommandLine.Tests;
65
using System.CommandLine.Tests.Utility;
76
using FluentAssertions;
87
using System.Linq;

src/System.CommandLine.Rendering.Tests/Views/ContentViewTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System.Collections.Generic;
55
using System.CommandLine.Rendering.Views;
6-
using System.CommandLine.Tests;
76
using System.CommandLine.Tests.Utility;
87
using System.Drawing;
98
using FluentAssertions;

src/System.CommandLine.Rendering.Tests/Views/ContentView{T}Tests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using System.CommandLine.Rendering.Views;
5-
using System.CommandLine.Tests;
65
using System.CommandLine.Tests.Utility;
76
using System.Drawing;
87
using FluentAssertions;

src/System.CommandLine.Rendering.Tests/Views/GridViewTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System.CommandLine.IO;
55
using System.CommandLine.Rendering.Views;
6-
using System.CommandLine.Tests;
76
using System.CommandLine.Tests.Utility;
87
using System.Drawing;
98
using FluentAssertions;

src/System.CommandLine.Rendering.Tests/Views/LayoutViewTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using System.CommandLine.Rendering.Views;
5-
using System.CommandLine.Tests;
65
using System.CommandLine.Tests.Utility;
76
using FluentAssertions;
87
using Xunit;

src/System.CommandLine.Rendering.Tests/Views/ScreenViewTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System.Collections.Generic;
55
using System.CommandLine.Rendering.Views;
6-
using System.CommandLine.Tests;
76
using System.CommandLine.Tests.Utility;
87
using System.Linq;
98
using System.Threading;

src/System.CommandLine.Rendering.Tests/Views/StackLayoutViewTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using System.CommandLine.Rendering.Views;
5-
using System.CommandLine.Tests;
65
using System.CommandLine.Tests.Utility;
76
using System.Drawing;
87
using FluentAssertions;

src/System.CommandLine.Suggest.Tests/DotnetSuggestEndToEndTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
using System.CommandLine.Invocation;
5-
using System.CommandLine.Tests;
65
using System.CommandLine.Tests.Utility;
76
using System.IO;
87
using FluentAssertions;

src/System.CommandLine/ArgumentArity.cs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using System.Collections;
55
using System.CommandLine.Binding;
66
using System.CommandLine.Parsing;
7-
using System.Linq;
87

98
namespace System.CommandLine
109
{
@@ -59,21 +58,9 @@ internal static FailedArgumentConversionArityResult Validate(
5958

6059
if (tokenCount > maximumNumberOfValues)
6160
{
62-
if (maximumNumberOfValues == 1)
63-
{
64-
return new TooManyArgumentsConversionResult(
65-
argument,
66-
symbolResult.ValidationMessages.ExpectsOneArgument(symbolResult));
67-
}
68-
else
69-
{
70-
return new TooManyArgumentsConversionResult(
71-
argument,
72-
symbolResult.ValidationMessages.ExpectsFewerArguments(
73-
symbolResult.Tokens.Last(),
74-
tokenCount,
75-
maximumNumberOfValues));
76-
}
61+
return new TooManyArgumentsConversionResult(
62+
argument,
63+
symbolResult.ValidationMessages.ExpectsOneArgument(symbolResult));
7764
}
7865

7966
return null;

0 commit comments

Comments
 (0)