Skip to content

Support async methods in MapResult extension method #248

Closed
@kensykora

Description

@kensykora

Inside my verb handlers I have async calls, and it'd be nice if there were support for async methods this way.

e.g.,

int Main(string[] args) {
  return Parser.Default.ParseArguments<AddOptions, CommitOptions, CloneOptions>(args)
    .MapResultAsync(
      async (AddOptions opts) => RunAddAndReturnExitCodeAsync(opts),
      async (CommitOptions opts) => RunCommitAndReturnExitCodeAsync(opts),
      async (CloneOptions opts) => RunCloneAndReturnExitCodeAsync(opts),
      errs => 1);
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions