Skip to content

Commit cf68185

Browse files
authored
Merge pull request #2469 from KathleenDollard/m-cleanup
Misc cleanup
2 parents 2896783 + 098913c commit cf68185

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/System.CommandLine.Subsystems/CompletionSubsystem.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66

77
namespace System.CommandLine;
88

9+
// Notes from Chet's work on static shells and further thoughts
10+
// - Chet has work he can later upstream for completion script creation - static when it can be
11+
// - Completions need to know - what it is, whether it is static or dynamic, and how many items would be in the list.
12+
// - Not sure whether these need to be in the Completer or the trait
13+
// - Validation can have many validators per type. Completions may need to have a single one.
14+
// - Probably two steps - determining the available values and matching the current word
15+
// - The code in CompletionContext of main/Extended to get current word requires tokens and is pretty gnarly
16+
// - File and directory are special as they can get handed off to shell ro the work
17+
918
public class CompletionSubsystem : CliSubsystem
1019
{
1120
public CompletionSubsystem(IAnnotationProvider? annotationProvider = null)

src/System.CommandLine.Subsystems/HelpSubsystem.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ namespace System.CommandLine;
1818
public class HelpSubsystem(IAnnotationProvider? annotationProvider = null)
1919
: CliSubsystem(HelpAnnotations.Prefix, SubsystemKind.Help, annotationProvider)
2020
{
21+
/// <summary>
22+
/// Gets the help option, which allows the user to customize
23+
/// </summary>
24+
/// <remarks>
25+
/// By design, the user can modify the help option but not replace it. This allows us to
26+
/// do the fastest possible lookup of whether help was called, and we aren't clear why
27+
/// the option would need to be replaced
28+
/// </remarks>
2129
public CliOption<bool> HelpOption { get; } = new CliOption<bool>("--help", ["-h"])
2230
{
2331
// TODO: Why don't we accept bool like any other bool option?

src/System.CommandLine.Subsystems/Subsystems/Annotations/VersionAnnotations.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,4 @@ namespace System.CommandLine.Subsystems.Annotations;
99
public static class VersionAnnotations
1010
{
1111
public static string Prefix { get; } = nameof(SubsystemKind.Version);
12-
13-
public static AnnotationId<string> Version { get; } = new(Prefix, nameof(Version));
1412
}

0 commit comments

Comments
 (0)