Class DefaultProgram
This class provides a default implementation of a program that uses the CommandsFramework. There are options for supplying the application name, version, and website. Customize these options in order to control how the list of available commands and usage information is displayed.
Implements
Inherited Members
Namespace: Benday.CommandsFramework
Assembly: Benday.CommandsFramework.dll
Syntax
public class DefaultProgram : ICommandProgram
Constructors
| Edit this page View SourceDefaultProgram(DefaultProgramOptions, Assembly)
Constructor
Declaration
public DefaultProgram(DefaultProgramOptions options, Assembly implementationAssembly)
Parameters
| Type | Name | Description |
|---|---|---|
| DefaultProgramOptions | options | Display options such as application name, version, and website |
| Assembly | implementationAssembly | Assembly that contains your command implementations |
Properties
| Edit this page View SourceImplementationAssembly
Declaration
public Assembly ImplementationAssembly { get; }
Property Value
| Type | Description |
|---|---|
| Assembly |
Options
Declaration
public ICommandProgramOptions Options { get; }
Property Value
| Type | Description |
|---|---|
| ICommandProgramOptions |
OutputProvider
Declaration
public ITextOutputProvider OutputProvider { get; }
Property Value
| Type | Description |
|---|---|
| ITextOutputProvider |
Methods
| Edit this page View SourceDisplayCommandsWithCategories(List<CommandAttribute>)
Displays the usage information for the program and all available commands displayed by category.
Declaration
public virtual void DisplayCommandsWithCategories(List<CommandAttribute> commands)
Parameters
| Type | Name | Description |
|---|---|---|
| List<CommandAttribute> | commands | List of commands |
DisplayCommandsWithoutCategories(List<CommandAttribute>)
Displays the usage information for the program and all available commands displayed alphabetically.
Declaration
public virtual void DisplayCommandsWithoutCategories(List<CommandAttribute> commands)
Parameters
| Type | Name | Description |
|---|---|---|
| List<CommandAttribute> | commands | List of commands |
DisplayUsage(CommandAttributeUtility)
Displays the usage information for the program and all available commands.
Declaration
public virtual void DisplayUsage(CommandAttributeUtility util)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandAttributeUtility | util |
Run(string[])
Declaration
public void Run(string[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | args |