Skip to content

Commit f8d9472

Browse files
committed
...still more XML comments
1 parent 66388c6 commit f8d9472

File tree

4 files changed

+131
-57
lines changed

4 files changed

+131
-57
lines changed

src/System.CommandLine/Builder/CommandLineBuilderExtensions.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,6 @@ public static CommandLineBuilder UseLocalizationResources(
684684
/// Enables the use of a option (defaulting to the alias <c>--version</c>) which when specified in command line input will short circuit normal command handling and instead write out version information before exiting.
685685
/// </summary>
686686
/// <param name="builder">A command line builder.</param>
687-
/// <param name="aliases">One or more aliases to use instead of the default to signal that version information should be displayed.</param>
688687
/// <returns>The same instance of <see cref="CommandLineBuilder"/>.</returns>
689688
public static CommandLineBuilder UseVersionOption(
690689
this CommandLineBuilder builder)
@@ -720,9 +719,12 @@ public static CommandLineBuilder UseVersionOption(
720719

721720
return builder;
722721
}
722+
723+
/// <inheritdoc cref="UseVersionOption(System.CommandLine.Builder.CommandLineBuilder)"/>
724+
/// <param name="aliases">One or more aliases to use instead of the default to signal that version information should be displayed.</param>
723725
public static CommandLineBuilder UseVersionOption(
724726
this CommandLineBuilder builder,
725-
params string[]? aliases)
727+
params string[] aliases)
726728
{
727729
var command = builder.Command;
728730

src/System.CommandLine/CommandLineConfiguration.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class CommandLineConfiguration
2626
/// <param name="symbols">The symbols to parse.</param>
2727
/// <param name="enablePosixBundling"><see langword="true"/> to enable POSIX bundling; otherwise, <see langword="false"/>.</param>
2828
/// <param name="enableDirectives"><see langword="true"/> to enable directive parsing; otherwise, <see langword="false"/>.</param>
29+
/// <param name="enableLegacyDoubleDashBehavior">Enables the legacy behavior of the <c>--</c> token, which is to ignore parsing of subsequent tokens and place them in the <see cref="ParseResult.UnparsedTokens"/> list.</param>
2930
/// <param name="resources">Provide custom validation messages.</param>
3031
/// <param name="responseFileHandling">One of the enumeration values that specifies how response files (.rsp) are handled.</param>
3132
/// <param name="middlewarePipeline">Provide a custom middleware pipeline.</param>
@@ -37,6 +38,7 @@ public CommandLineConfiguration(
3738
IReadOnlyList<Symbol> symbols,
3839
bool enablePosixBundling = true,
3940
bool enableDirectives = true,
41+
bool enableLegacyDoubleDashBehavior = false,
4042
Resources? resources = null,
4143
ResponseFileHandling responseFileHandling = ResponseFileHandling.ParseArgsAsLineSeparated,
4244
IReadOnlyCollection<InvocationMiddleware>? middlewarePipeline = null,
@@ -84,6 +86,7 @@ public CommandLineConfiguration(
8486

8587
AddGlobalOptionsToChildren(rootCommand);
8688

89+
EnableLegacyDoubleDashBehavior = enableLegacyDoubleDashBehavior;
8790
EnablePosixBundling = enablePosixBundling;
8891
EnableDirectives = enableDirectives;
8992
Resources = resources ?? Resources.Instance;
@@ -145,6 +148,11 @@ private void AddGlobalOptionsToChildren(Command parentCommand)
145148
/// </summary>
146149
public bool EnableDirectives { get; }
147150

151+
/// <summary>
152+
/// Enables the legacy behavior of the <c>--</c> token, which is to ignore parsing of subsequent tokens and place them in the <see cref="ParseResult.UnparsedTokens"/> list.
153+
/// </summary>
154+
public bool EnableLegacyDoubleDashBehavior { get; }
155+
148156
/// <summary>
149157
/// Gets whether POSIX bundling is enabled.
150158
/// </summary>

src/System.CommandLine/Invocation/CommandHandler.NameBasedBinding.cs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -484,152 +484,152 @@ public static ICommandHandler Create<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T1
484484
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
485485

486486
/// <summary>
487-
/// Creates a command handler based on a <see cref="Func{Task{Int32}}"/>.
487+
/// Creates a command handler based on a <see cref="Func{Task}"/>.
488488
/// </summary>
489-
/// <param name="action">The <see cref="Func{Task{Int32}}"/> to be called when the command handler is invoked.</param>
489+
/// <param name="action">The <see cref="Func{Task}"/> to be called when the command handler is invoked.</param>
490490
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
491491
public static ICommandHandler Create(Func<Task<int>> action) =>
492492
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
493493

494494
/// <summary>
495-
/// Creates a command handler based on a <see cref="Func{T,Task{Int32}}"/>.
495+
/// Creates a command handler based on a <see cref="Func{T,Task}"/>.
496496
/// </summary>
497-
/// <param name="action">The <see cref="Func{T,Task{Int32}}"/> to be called when the command handler is invoked.</param>
497+
/// <param name="action">The <see cref="Func{T,Task}"/> to be called when the command handler is invoked.</param>
498498
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
499499
public static ICommandHandler Create<T>(
500500
Func<T, Task<int>> action) =>
501501
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
502502

503503
/// <summary>
504-
/// Creates a command handler based on a <see cref="Func{T1,T2,Task{Int32}}"/>.
504+
/// Creates a command handler based on a <see cref="Func{T1,T2,Task}"/>.
505505
/// </summary>
506-
/// <param name="action">The <see cref="Func{T1,T2,Task{Int32}}"/> to be called when the command handler is invoked.</param>
506+
/// <param name="action">The <see cref="Func{T1,T2,Task}"/> to be called when the command handler is invoked.</param>
507507
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
508508
public static ICommandHandler Create<T1, T2>(
509509
Func<T1, T2, Task<int>> action) =>
510510
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
511511

512512
/// <summary>
513-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,Task{Int32}}"/>.
513+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,Task}"/>.
514514
/// </summary>
515-
/// <param name="action">The <see cref="Func{T1,T2,T3,Task{Int32}}"/> to be called when the command handler is invoked.</param>
515+
/// <param name="action">The <see cref="Func{T1,T2,T3,Task}"/> to be called when the command handler is invoked.</param>
516516
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
517517
public static ICommandHandler Create<T1, T2, T3>(
518518
Func<T1, T2, T3, Task<int>> action) =>
519519
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
520520

521521
/// <summary>
522-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,Task{Int32}}"/>.
522+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,Task}"/>.
523523
/// </summary>
524-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,Task{Int32}}"/> to be called when the command handler is invoked.</param>
524+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,Task}"/> to be called when the command handler is invoked.</param>
525525
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
526526
public static ICommandHandler Create<T1, T2, T3, T4>(
527527
Func<T1, T2, T3, T4, Task<int>> action) =>
528528
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
529529

530530
/// <summary>
531-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,Task{Int32}}"/>.
531+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,Task}"/>.
532532
/// </summary>
533-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,Task{Int32}}"/> to be called when the command handler is invoked.</param>
533+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,Task}"/> to be called when the command handler is invoked.</param>
534534
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
535535
public static ICommandHandler Create<T1, T2, T3, T4, T5>(
536536
Func<T1, T2, T3, T4, T5, Task<int>> action) =>
537537
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
538538

539539
/// <summary>
540-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,Task{Int32}}"/>.
540+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,Task}"/>.
541541
/// </summary>
542-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,Task{Int32}}"/> to be called when the command handler is invoked.</param>
542+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,Task}"/> to be called when the command handler is invoked.</param>
543543
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
544544
public static ICommandHandler Create<T1, T2, T3, T4, T5, T6>(
545545
Func<T1, T2, T3, T4, T5, T6, Task<int>> action) =>
546546
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
547547

548548
/// <summary>
549-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,Task{Int32}}"/>.
549+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,Task}"/>.
550550
/// </summary>
551-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,Task{Int32}}"/> to be called when the command handler is invoked.</param>
551+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,Task}"/> to be called when the command handler is invoked.</param>
552552
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
553553
public static ICommandHandler Create<T1, T2, T3, T4, T5, T6, T7>(
554554
Func<T1, T2, T3, T4, T5, T6, T7, Task<int>> action) =>
555555
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
556556

557557
/// <summary>
558-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,Task{Int32}}"/>.
558+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,Task}"/>.
559559
/// </summary>
560-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,Task{Int32}}"/> to be called when the command handler is invoked.</param>
560+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,Task}"/> to be called when the command handler is invoked.</param>
561561
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
562562
public static ICommandHandler Create<T1, T2, T3, T4, T5, T6, T7, T8>(
563563
Func<T1, T2, T3, T4, T5, T6, T7, T8, Task<int>> action) =>
564564
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
565565

566566
/// <summary>
567-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,Task{Int32}}"/>.
567+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,Task}"/>.
568568
/// </summary>
569-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,Task{Int32}}"/> to be called when the command handler is invoked.</param>
569+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,Task}"/> to be called when the command handler is invoked.</param>
570570
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
571571
public static ICommandHandler Create<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
572572
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, Task<int>> action) =>
573573
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
574574

575575
/// <summary>
576-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,Task{Int32}}"/>.
576+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,Task}"/>.
577577
/// </summary>
578-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,Task{Int32}}"/> to be called when the command handler is invoked.</param>
578+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,Task}"/> to be called when the command handler is invoked.</param>
579579
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
580580
public static ICommandHandler Create<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
581581
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Task<int>> action) =>
582582
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
583583

584584
/// <summary>
585-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,Task{Int32}}"/>.
585+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,Task}"/>.
586586
/// </summary>
587-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,Task{Int32}}"/> to be called when the command handler is invoked.</param>
587+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,Task}"/> to be called when the command handler is invoked.</param>
588588
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
589589
public static ICommandHandler Create<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(
590590
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Task<int>> action) =>
591591
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
592592

593593
/// <summary>
594-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,Task{Int32}}"/>.
594+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,Task}"/>.
595595
/// </summary>
596-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,Task{Int32}}"/> to be called when the command handler is invoked.</param>
596+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,Task}"/> to be called when the command handler is invoked.</param>
597597
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
598598
public static ICommandHandler Create<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(
599599
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, Task<int>> action) =>
600600
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
601601

602602
/// <summary>
603-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,Task{Int32}}"/>.
603+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,Task}"/>.
604604
/// </summary>
605-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,Task{Int32}}"/> to be called when the command handler is invoked.</param>
605+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,Task}"/> to be called when the command handler is invoked.</param>
606606
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
607607
public static ICommandHandler Create<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(
608608
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Task<int>> action) =>
609609
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
610610

611611
/// <summary>
612-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,Task{Int32}}"/>.
612+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,Task}"/>.
613613
/// </summary>
614-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,Task{Int32}}"/> to be called when the command handler is invoked.</param>
614+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,Task}"/> to be called when the command handler is invoked.</param>
615615
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
616616
public static ICommandHandler Create<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(
617617
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, Task<int>> action) =>
618618
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
619619

620620
/// <summary>
621-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,Task{Int32}}"/>.
621+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,Task}"/>.
622622
/// </summary>
623-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,Task{Int32}}"/> to be called when the command handler is invoked.</param>
623+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,Task}"/> to be called when the command handler is invoked.</param>
624624
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
625625
public static ICommandHandler Create<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(
626626
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, Task<int>> action) =>
627627
HandlerDescriptor.FromDelegate(action).GetCommandHandler();
628628

629629
/// <summary>
630-
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,Task{Int32}}"/>.
630+
/// Creates a command handler based on a <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,Task}"/>.
631631
/// </summary>
632-
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,Task{Int32}}"/> to be called when the command handler is invoked.</param>
632+
/// <param name="action">The <see cref="Func{T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,Task}"/> to be called when the command handler is invoked.</param>
633633
/// <returns>An instance of <see cref="ICommandHandler"/>.</returns>
634634
public static ICommandHandler Create<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(
635635
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, Task<int>> action) =>

0 commit comments

Comments
 (0)