IDiagCommand Pennington.Cli
A diag subcommand. Implementations register in DI as IDiagCommand; the CLI discovers them and adds one System.CommandLine Command per implementation under the diag group. Each command inspects the started app's services and writes a human-readable text report. Optional packages (and hosts) add their own inspection verbs by registering an implementation.
Properties
Descriptionstring- One-line description shown in
diag --help. Namestring- Subcommand verb shown under
diag(e.g.toc,warnings).
Methods
Build
#public Command Build(IServiceProvider services, TextWriter output)
Builds the System.CommandLine Command for this subcommand, wiring its options and an action that inspects services (a fully started host's service provider) and writes to output. The action returns the process exit code.
Parameters
servicesIServiceProvideroutputTextWriter
Returns
CommandPennington.Cli.IDiagCommand
namespace Pennington.Cli;
/// A diag subcommand. Implementations register in DI as IDiagCommand; the CLI discovers them and adds one System.CommandLine Command per implementation under the diag group. Each command inspects the started app's services and writes a human-readable text report. Optional packages (and hosts) add their own inspection verbs by registering an implementation.
public interface IDiagCommand
{
/// Builds the System.CommandLine Command for this subcommand, wiring its options and an action that inspects services (a fully started host's service provider) and writes to output. The action returns the process exit code.
public Command Build(IServiceProvider services, TextWriter output)
;
/// One-line description shown in diag --help.
public string Description { get; }
/// Subcommand verb shown under diag (e.g. toc, warnings).
public string Name { get; }
}