Skip to content

Commit f0ead71

Browse files
Added new subsystems
1 parent 01bf648 commit f0ead71

File tree

5 files changed

+54
-4
lines changed

5 files changed

+54
-4
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System.CommandLine.Subsystems;
5+
using System.CommandLine.Subsystems.Annotations;
6+
7+
namespace System.CommandLine;
8+
9+
public class InvocationSubsystem(IAnnotationProvider? annotationProvider = null)
10+
: CliSubsystem(InvocationAnnotations.Prefix, SubsystemKind.Invocation, annotationProvider)
11+
{}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
namespace System.CommandLine.Subsystems.Annotations;
5+
6+
/// <summary>
7+
/// IDs for well-known Version annotations.
8+
/// </summary>
9+
public static class InvocationAnnotations
10+
{
11+
internal static string Prefix { get; } = nameof(SubsystemKind.Invocation);
12+
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
namespace System.CommandLine.Subsystems.Annotations;
5+
6+
/// <summary>
7+
/// IDs for well-known Version annotations.
8+
/// </summary>
9+
public static class ValidationAnnotations
10+
{
11+
internal static string Prefix { get; } = nameof(SubsystemKind.Validation);
12+
13+
}

src/System.CommandLine.Subsystems/Subsystems/SubsystemKind.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ namespace System.CommandLine.Subsystems;
66
public enum SubsystemKind
77
{
88
Other = 0,
9+
Diagram,
10+
Completion,
911
Help,
1012
Version,
11-
Value,
13+
Validation,
14+
Invocation,
1215
ErrorReporting,
13-
Completion,
14-
Diagram,
15-
Response
16+
Value,
17+
Response,
1618
}
1719

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System.CommandLine.Subsystems;
5+
using System.CommandLine.Subsystems.Annotations;
6+
7+
namespace System.CommandLine;
8+
9+
public class ValidationSubsystem(IAnnotationProvider? annotationProvider = null)
10+
: CliSubsystem(ValidationAnnotations.Prefix, SubsystemKind.Validation, annotationProvider)
11+
{ }

0 commit comments

Comments
 (0)