Skip to content

Commit 303b543

Browse files
committed
Stub Annotation classes for consistent use of Prefix
1 parent fc074ef commit 303b543

File tree

5 files changed

+30
-4
lines changed

5 files changed

+30
-4
lines changed

src/System.CommandLine.Subsystems/CompletionSubsystem.cs

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

44
using System.CommandLine.Subsystems;
5+
using System.CommandLine.Subsystems.Annotations;
56

67
namespace System.CommandLine;
78

89
public class CompletionSubsystem : CliSubsystem
910
{
1011
public CompletionSubsystem(IAnnotationProvider? annotationProvider = null)
11-
: base("Completion", annotationProvider, SubsystemKind.Completion)
12+
: base(CompletionAnnotations.Prefix, annotationProvider, SubsystemKind.Completion)
1213
{ }
1314

1415
// TODO: Figure out trigger for completions

src/System.CommandLine.Subsystems/ErrorReportingSubsystem.cs

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

44
using System.CommandLine.Subsystems;
5+
using System.CommandLine.Subsystems.Annotations;
56

67
namespace System.CommandLine;
78

89
public class ErrorReportingSubsystem : CliSubsystem
910
{
1011
public ErrorReportingSubsystem(IAnnotationProvider? annotationProvider = null)
11-
: base("ErrorReporting", annotationProvider, SubsystemKind.ErrorReporting)
12+
: base(ErrorReportingAnnotations.Prefix, annotationProvider, SubsystemKind.ErrorReporting)
1213
{ }
1314

1415
// TODO: Stash option rather than using string
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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 Completion annotations.
8+
/// </summary>
9+
public static class CompletionAnnotations
10+
{
11+
public static string Prefix { get; } = nameof(SubsystemKind.Completion);
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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 ErrorReporting annotations.
8+
/// </summary>
9+
public static class ErrorReportingAnnotations
10+
{
11+
public static string Prefix { get; } = nameof(SubsystemKind.ErrorReporting);
12+
}

src/System.CommandLine.Subsystems/VersionSubsystem.cs

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

44
using System.CommandLine.Subsystems;
5+
using System.CommandLine.Subsystems.Annotations;
56
using System.Reflection;
67

78
namespace System.CommandLine;
@@ -11,11 +12,10 @@ public class VersionSubsystem : CliSubsystem
1112
private string? specificVersion = null;
1213

1314
public VersionSubsystem(IAnnotationProvider? annotationProvider = null)
14-
: base("Version", annotationProvider, SubsystemKind.Version)
15+
: base(VersionAnnotations.Prefix, annotationProvider, SubsystemKind.Version)
1516
{
1617
}
1718

18-
1919
// TODO: Should we block adding version anywhere but root?
2020
public string? SpecificVersion
2121
{

0 commit comments

Comments
 (0)