internal static async Task Main(string[] args) { ParserResult <object> result = Parser.Default.ParseArguments <ScaffoldTestOptions, IdentifyMissingTestsOptions, DownloadDriversOptions, ApiCheckerOptions>(args); result.WithParsed <ScaffoldTestOptions>(ScaffoldTest.Run); result.WithParsed <IdentifyMissingTestsOptions>(IdentifyMissingTests.Run); await result.WithParsedAsync <DownloadDriversOptions>(DriverDownloader.RunAsync).ConfigureAwait(false); await result.WithParsedAsync <ApiCheckerOptions>(ApiChecker.RunAsync).ConfigureAwait(false); }
public void TryParseAsync(IEnumerable <string> args, Func <T, Task> success) { ParserResult <T> result = Parser.Default.ParseArguments <T>(args); result.WithParsedAsync(success); result.WithNotParsed((IEnumerable <Error> errors) => DisplayHelp(result, errors)); }
public async Task <int> RunAsync() { _cliArgs.WithNotParsed(HandleErrors); await _cliArgs.WithParsedAsync(ExecuteArgumentsAsync); return(0); }
internal static async Task Main(string[] args) { ParserResult <DownloadDriversOptions> result = Parser.Default.ParseArguments <DownloadDriversOptions>(args); await result.WithParsedAsync(DriverDownloader.RunAsync).ConfigureAwait(false); }