Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dotnet/command-line-api
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: epsitec-sa/command-line-api
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Aug 17, 2023

  1. Copy the full SHA
    297dae8 View commit details

Commits on Sep 19, 2023

  1. Disable Arcade SDK.

    rvuistin committed Sep 19, 2023
    Copy the full SHA
    d12eb4b View commit details
  2. Fix XML doc warnings.

    rvuistin committed Sep 19, 2023
    Copy the full SHA
    74e2ada View commit details
  3. Fix NETSDK1211 warning...

    - EnableSingleFileAnalyzer is not supported for the target framework
    rvuistin committed Sep 19, 2023
    Copy the full SHA
    37ab712 View commit details

Commits on Nov 16, 2023

  1. Copy the full SHA
    4cd7780 View commit details

Commits on Nov 23, 2023

  1. Update nuget packages.

    rvuistin committed Nov 23, 2023
    Copy the full SHA
    0ca0e2b View commit details

Commits on Dec 4, 2023

  1. zou-flow: merge 'upstream/main' into 'main'

    # zou-flow - 6.2.4.2347 net7
    rvuistin committed Dec 4, 2023
    Copy the full SHA
    153b8e1 View commit details

Commits on Dec 5, 2023

  1. Bump framework to net8.

    rvuistin committed Dec 5, 2023
    Copy the full SHA
    3c0f140 View commit details

Commits on Mar 2, 2024

  1. zou-flow: merge 'upstream/main' into 'main'

    # zou-flow - 8.2.2.2404 net8.0
    rvuistin committed Mar 2, 2024
    Copy the full SHA
    c1576fa View commit details

Commits on Mar 9, 2024

  1. Update nuget packages.

    # zou-flow - 8.2.2.2404 net8.0
    rvuistin committed Mar 9, 2024
    Copy the full SHA
    3f9de40 View commit details
  2. zou-flow: bump version to 'v0.1.0'.

    # zou-flow - 8.2.2.2404 net8.0
    rvuistin committed Mar 9, 2024
    Copy the full SHA
    da50a7a View commit details

Commits on Apr 23, 2024

  1. Copy the full SHA
    3880bef View commit details
  2. zou-flow: bump version to 'v0.1.1'.

    # zou-flow - 8.4.1.2416 net8.0
    rvuistin committed Apr 23, 2024
    Copy the full SHA
    53d5031 View commit details

Commits on Jun 5, 2024

  1. Copy the full SHA
    2d6aca3 View commit details

Commits on Jun 6, 2024

  1. Copy the full SHA
    dce1710 View commit details
  2. Copy the full SHA
    839a9ec View commit details

Commits on Jun 13, 2024

  1. zou-flow: start vbranch '1.0'...

    - create empty commit to avoid vbranch/vtag pushes.
    # zou-flow - 8.4.5.2423 net8.0
    rvuistin committed Jun 13, 2024
    Copy the full SHA
    e9606a4 View commit details

Commits on Jul 27, 2024

  1. Revert "Improve default exception handler to support aggregated cance…

    …ling."
    
    This reverts commit 297dae8.
    rvuistin committed Jul 27, 2024
    Copy the full SHA
    711ab4d View commit details
  2. zou-flow: bump version to 'v1.0.1'.

    # zou-flow - 11.0.1.2429 net8.0
    rvuistin committed Jul 27, 2024
    Copy the full SHA
    69a3ffa View commit details

Commits on Sep 7, 2024

  1. Copy the full SHA
    17a08e0 View commit details

Commits on Oct 10, 2024

  1. Update nuget packages...

    - keep Sqlite and EntityFramework to v7.0.2
    - update test packages to latest minor version
    # zou-flow - 12.9.0.2441 net8.0
    rvuistin committed Oct 10, 2024
    Copy the full SHA
    c8d6b9e View commit details

Commits on Oct 24, 2024

  1. Update nuget packages (CPM)

    rvuistin committed Oct 24, 2024
    Copy the full SHA
    62cd954 View commit details

Commits on Nov 9, 2024

  1. Copy the full SHA
    81ef252 View commit details

Commits on Jan 5, 2025

  1. Switch to net9.

    rvuistin committed Jan 5, 2025
    Copy the full SHA
    630af48 View commit details

Commits on Jan 15, 2025

  1. zou-flow: start vbranch '2.1'...

    - create empty commit to avoid vbranch/vtag pushes.
    # zou-flow - 12.14.4.2451 net9.0
    rvuistin committed Jan 15, 2025
    Copy the full SHA
    c799719 View commit details

Commits on Mar 17, 2025

  1. Zouify build system.

    rvuistin committed Mar 17, 2025
    Copy the full SHA
    8c50d7c View commit details

Commits on Mar 31, 2025

  1. zou: bump version to 'v2.1.1'.

    # zou-flow - 13.1.0.2505 net9.0
    rvuistin committed Mar 31, 2025
    Copy the full SHA
    0af7914 View commit details
17 changes: 2 additions & 15 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
<Project>

<Import Project="Sdk.props"
Sdk="Microsoft.DotNet.Arcade.Sdk"
Condition="'$(DisableArcade)' != '1'" />
<Import Project="$([MSBuild]::GetPathOfFileAbove('$(MSBuildThisFile)', '$(MSBuildThisFileDirectory)../'))" />

<PropertyGroup>
<NoWarn>$(NoWarn);NU5125;CS0618</NoWarn>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<LangVersion>10.0</LangVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(DotNetBuildFromSource)' == 'true' or '$(DotNetBuildSourceOnly)' == 'true'">
<TargetFrameworkForNETSDK>$(NetCurrent)</TargetFrameworkForNETSDK>
</PropertyGroup>

<PropertyGroup Condition="'$(DotNetBuildFromSource)' != 'true' and '$(DotNetBuildSourceOnly)' != 'true'">
<TargetFrameworkForNETSDK>net7.0</TargetFrameworkForNETSDK>
<TargetFrameworkForNETSDK>$(CoreTargetFramework)</TargetFrameworkForNETSDK>
</PropertyGroup>

</Project>
21 changes: 0 additions & 21 deletions Directory.Build.targets

This file was deleted.

37 changes: 0 additions & 37 deletions Directory.Packages.props

This file was deleted.

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<IsPackable>true</IsPackable>
<TargetFrameworks>netstandard2.0;netstandard2.1;$(TargetFrameworkForNETSDK)</TargetFrameworks>
<Description>This package provides support for using System.CommandLine with Microsoft.Extensions.Hosting.</Description>
</PropertyGroup>

Original file line number Diff line number Diff line change
@@ -17,6 +17,11 @@ private sealed class DummyStateHoldingHandler : BindingHandler
public override Task<int> InvokeAsync(ParseResult parseResult, CancellationToken cancellationToken = default) => Task.FromResult(0);
}

/// <summary>
/// <inheritdoc cref="BindingHandler.GetBindingContext(ParseResult)"/>
/// </summary>
/// <param name="parseResult"></param>
/// <returns></returns>
public static BindingContext GetBindingContext(this ParseResult parseResult)
{
// parsing resulted with no handler or it was not created yet, we fake it to just store the BindingContext between the calls
Original file line number Diff line number Diff line change
@@ -6,6 +6,9 @@

namespace System.CommandLine.NamingConventionBinder
{
/// <summary>
/// <inheritdoc cref="AsynchronousCliAction"/>
/// </summary>
public abstract class BindingHandler : AsynchronousCliAction
{
private BindingContext? _bindingContext;
Original file line number Diff line number Diff line change
@@ -3,8 +3,6 @@
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>System.CommandLine.NamingConventionBinder</PackageId>
<TargetFrameworks>$(TargetFrameworkForNETSDK);netstandard2.0</TargetFrameworks>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<Description>This package provides command handler support for System.CommandLine performs parameter and model binding by matching option and argument names to parameter and property names.</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
21 changes: 21 additions & 0 deletions src/System.CommandLine/CliCommand.cs
Original file line number Diff line number Diff line change
@@ -181,12 +181,27 @@ public void SetAction(Func<ParseResult, CancellationToken, Task<int>> action)
/// <param name="command">The Command to add to the command.</param>
public void Add(CliCommand command) => Subcommands.Add(command);

/// <summary>
/// Enable double dash (--) greedy parsing mode (consider all tokens after a double dash as unmatched).<br/>
/// Unmatched tokens are available after parsing in <see cref="ParseResult.UnmatchedTokens"/>.
/// </summary>
public void EnableDoubleDashGreedyMode()
{
TreatDoubleDashTokensAsUnmatched = true;
TreatUnmatchedTokensAsErrors = false;
}

/// <summary>
/// Gets or sets a value that indicates whether unmatched tokens should be treated as errors. For example,
/// if set to <see langword="true"/> and an extra command or argument is provided, validation will fail.
/// </summary>
public bool TreatUnmatchedTokensAsErrors { get; set; } = true;

/// <summary>
/// Gets or sets a value that indicates whether tokens after a double dash should be considered as unmatched.
/// </summary>
internal bool TreatDoubleDashTokensAsUnmatched { get; set; } = false;

/// <inheritdoc />
[DebuggerStepThrough]
[EditorBrowsable(EditorBrowsableState.Never)] // hide from intellisense, it's public for C# collection initializer
@@ -309,5 +324,11 @@ void AddCompletionsFor(CliSymbol identifier, AliasSet? aliases)

internal bool EqualsNameOrAlias(string name)
=> Name.Equals(name, StringComparison.Ordinal) || (_aliases is not null && _aliases.Contains(name));

/// <summary>
/// Allows the caller to configure this command before starting parsing.
/// </summary>
/// <param name="commandResult">The parsing status prior to starting.</param>
protected internal virtual void OnParsing(CommandResult commandResult) { }
}
}
21 changes: 20 additions & 1 deletion src/System.CommandLine/Parsing/ParseOperation.cs
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ internal sealed class ParseOperation
private CommandResult _innermostCommandResult;
private bool _isHelpRequested;
private bool _isTerminatingDirectiveSpecified;
private bool _isDoubleDashSpecified;
private CliAction? _primaryAction;
private List<CliAction>? _preActions;

@@ -49,11 +50,22 @@ private bool More(out CliTokenType currentTokenType)
{
bool result = _index < _tokens.Count;
currentTokenType = result ? _tokens[_index].Type : (CliTokenType)(-1);
if (currentTokenType is CliTokenType.DoubleDash)
{
_isDoubleDashSpecified = true;
}
return result;
}

private void OnCommandParsing()
{
_innermostCommandResult.Command.OnParsing(_innermostCommandResult);
}

internal ParseResult Parse()
{
OnCommandParsing();

ParseDirectives();

ParseCommandChildren();
@@ -95,6 +107,8 @@ private void ParseSubcommand()

_symbolResultTree.Add(command, _innermostCommandResult);

OnCommandParsing();

Advance();

ParseCommandChildren();
@@ -107,7 +121,12 @@ private void ParseCommandChildren()

while (More(out CliTokenType currentTokenType))
{
if (currentTokenType == CliTokenType.Command)
if (_isDoubleDashSpecified && _innermostCommandResult.Command.TreatDoubleDashTokensAsUnmatched)
{
AddCurrentTokenToUnmatched();
Advance();
}
else if (currentTokenType == CliTokenType.Command)
{
ParseSubcommand();
}
2 changes: 0 additions & 2 deletions src/System.CommandLine/System.CommandLine.csproj
Original file line number Diff line number Diff line change
@@ -3,10 +3,8 @@
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>System.CommandLine</PackageId>
<TargetFrameworks>$(TargetFrameworkForNETSDK);netstandard2.0</TargetFrameworks>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
<Description>Support for parsing command lines, supporting both POSIX and Windows conventions and shell-agnostic command line completions.</Description>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>