// Copyright 2005-2015 Giacomo Stelluti Scala & Contributors. All rights reserved. See License.md in the project root for license information.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace CommandLine
{
public static partial class ParserResultExtensions
{
#if !NET40
///
/// Executes asynchronously if contains
/// parsed values.
///
/// Type of the target instance built with parsed value.
/// An instance.
/// The to execute.
/// The same instance as a instance.
public static async Task> WithParsedAsync(this ParserResult result, Func action)
{
if (result is Parsed parsed)
{
await action(parsed.Value);
}
return result;
}
///
/// Executes asynchronously if parsed values are of .
///
/// Type of the target instance built with parsed value.
/// An verb result instance.
/// The to execute.
/// The same instance as a instance.
public static async Task> WithParsedAsync(this ParserResult