Skip to content

Feature: allow to configure the InvocationContext/Console instance. #2087

@tmds

Description

@tmds

This is related to #2084.

The API would be on the CommandLineBuilder:

void UseInvocationContextFactory(Func<ParseResult, IConsole?, InvocationContext> factory);

Or mutable CommandLineConfiguration:

Func<ParseResult, IConsole?, InvocationContext> InvocationContextFactory { get; set; }

If the instance is IDisposable/IAsyncDisposable, it should be disposed at the end of the invocation.

Similarly, it would be interesting to have a way of controlling the default console:

void UseConsole(Func<ParseResult, IConsole> factory);
// or
Func<ParseResult, IConsole> ConsoleFactory { get; set; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions