Skip to content

Create Command #1

@Matthiee

Description

@Matthiee

Create Commands

Allow to use commands with custom options or no options at all.

Usage

  • myapp -param1 "something" -Add -A -m "Message"
  • myapp -Add -A -m "Message"
  • myapp -Add

Naming

  • ICommand, ICommand<T> where T : class

Behavior

Unmapped arguments by the ICommand will fall back to the global options if any exist.

Discovery

We can automatically discover the commands or they can be manually added.

  • Auto discover if class implements ICommand
  • Manually
    • parser.ConfigureCommand<ICommand>()
    • parser.ConfigureCommand<ICommand<Option>>(Expression<Func<Option>>)

Execution

Executing the command can be sync or async

  • ICommand.Execute()
  • ICommand.ExecuteAsync()
  • ICommand<Options>.Execute(Options)
  • ICommand<Options>.ExecuteAsync(Options)

Progress

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions