Skip to content

docs: fix the consumer sample, list Providers.GitHub, document version pairing - #81

Merged
StuartMeeks merged 1 commit into
mainfrom
docs/readme-2.0-followup
Aug 26, 2026
Merged

docs: fix the consumer sample, list Providers.GitHub, document version pairing#81
StuartMeeks merged 1 commit into
mainfrom
docs/readme-2.0-followup

Conversation

@StuartMeeks

Copy link
Copy Markdown
Owner

Follow-up to #80, now that the provider packages are being re-cut alongside 2.0.0.

A third broken snippet — my first pass missed it

The consumer sample does not compile against the Spectre version this package depends on:

CS0534: 'SyncCommand' does not implement inherited abstract member
        'AsyncCommand.ExecuteAsync(CommandContext, CancellationToken)'
CS0507: cannot change access modifiers when overriding 'protected' inherited member

It declared public override async Task<int> ExecuteAsync(CommandContext context). Spectre.Console.Cli 0.55's AsyncCommand takes (CommandContext, CancellationToken) and the member is protected — which is exactly what this repo's own commands do, so the sample was inconsistent with the code sitting next to it.

Corrected and compiled against 0.55.0, not eyeballed. Worth flagging that I reviewed this file end to end last time and still missed it: it is the sample showing how to use a token from a command handler, so probably the most-copied code in the README.

Two additions for the coordinated release

Providers.GitHub was added to the packages table in #80 but not to the install block. Both now list it.

Version pairing, which is the thing most likely to bite on this release:

This package Provider packages
2.x 2.x
1.x 1.0.1+

Stated with the reason rather than as a bare rule: the providers call into ICredentialManager, which changed shape in 2.0.0, so a 1.x provider assembly against 2.x of this package would fail at runtime with MissingMethodException. The major cap turns that into a resolution error at restore time.

Verification

Build clean, no code changed. The corrected sample compiles against Spectre.Console.Cli 0.55.0.

🤖 Generated with Claude Code

…n pairing

Three follow-ups now that the providers are being re-cut alongside 2.0.0.

The consumer sample does not compile, and my first review pass missed it. It
declared `public override async Task<int> ExecuteAsync(CommandContext context)`,
but Spectre.Console.Cli 0.55's AsyncCommand takes
`(CommandContext, CancellationToken)` and the member is protected:

  CS0534: does not implement inherited abstract member
          AsyncCommand.ExecuteAsync(CommandContext, CancellationToken)
  CS0507: cannot change access modifiers when overriding

Corrected to protected override with the token parameter, matching this repo's
own commands, and compiled against 0.55.0 rather than eyeballed. This is the
sample showing how to use a token from a command handler, so it is among the
most-copied code in the file.

Providers.GitHub was added to the packages table last pass but not to the
install block; both now list it.

Version pairing is documented because it is what will actually bite on this
release: the providers cap at the major boundary, so 2.x needs 2.x. Stated with
the reason -- the cap converts what would be a runtime MissingMethodException,
since the providers call ICredentialManager, into a resolution error at restore.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@StuartMeeks
StuartMeeks merged commit 1c63e32 into main Aug 26, 2026
11 checks passed
@StuartMeeks
StuartMeeks deleted the docs/readme-2.0-followup branch August 26, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant